mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-20 23:10:39 -04:00
fixed bug in circles edit dialog
This commit is contained in:
parent
8a6edba615
commit
1ecfbfcd02
1 changed files with 11 additions and 4 deletions
|
@ -707,23 +707,30 @@ void CreateCircleDialog::loadIdentities()
|
||||||
}
|
}
|
||||||
|
|
||||||
std::set<RsGxsId> ids;
|
std::set<RsGxsId> ids;
|
||||||
for(auto& meta:ids_meta) ids.insert(RsGxsId(meta.mGroupId));
|
for(auto& meta:ids_meta)
|
||||||
|
ids.insert(RsGxsId(meta.mGroupId));
|
||||||
|
|
||||||
|
// Needs a pointer on the heap, to pass to postToObject, otherwise it will get deleted before
|
||||||
|
// the posted method will actually run. Memory ownership is left to the posted method.
|
||||||
|
|
||||||
|
auto id_groups = new std::vector<RsGxsIdGroup>();
|
||||||
|
|
||||||
auto id_groups = std::make_unique<std::vector<RsGxsIdGroup>>();
|
|
||||||
if(!rsIdentity->getIdentitiesInfo(ids, *id_groups))
|
if(!rsIdentity->getIdentitiesInfo(ids, *id_groups))
|
||||||
{
|
{
|
||||||
RS_ERR("failed to retrieve identities group info for all identities");
|
RS_ERR("failed to retrieve identities group info for all identities");
|
||||||
|
delete id_groups;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
RsQThreadUtils::postToObject(
|
RsQThreadUtils::postToObject( [id_groups, this]()
|
||||||
[id_groups = std::move(id_groups), this]()
|
|
||||||
{
|
{
|
||||||
/* Here it goes any code you want to be executed on the Qt Gui
|
/* Here it goes any code you want to be executed on the Qt Gui
|
||||||
* thread, for example to update the data model with new information
|
* thread, for example to update the data model with new information
|
||||||
* after a blocking call to RetroShare API complete */
|
* after a blocking call to RetroShare API complete */
|
||||||
|
|
||||||
fillIdentitiesList(*id_groups);
|
fillIdentitiesList(*id_groups);
|
||||||
|
|
||||||
|
delete id_groups;
|
||||||
}, this );
|
}, this );
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue