mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-03-20 13:56:39 -04:00
fixed bug in circles edit dialog
This commit is contained in:
parent
8a6edba615
commit
1ecfbfcd02
@ -707,23 +707,30 @@ void CreateCircleDialog::loadIdentities()
|
||||
}
|
||||
|
||||
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))
|
||||
{
|
||||
RS_ERR("failed to retrieve identities group info for all identities");
|
||||
delete id_groups;
|
||||
return;
|
||||
}
|
||||
|
||||
RsQThreadUtils::postToObject(
|
||||
[id_groups = std::move(id_groups), this]()
|
||||
RsQThreadUtils::postToObject( [id_groups, this]()
|
||||
{
|
||||
/* 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
|
||||
* after a blocking call to RetroShare API complete */
|
||||
|
||||
fillIdentitiesList(*id_groups);
|
||||
|
||||
delete id_groups;
|
||||
}, this );
|
||||
});
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user