mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-26 23:36:59 -05:00
fixed wrong call to std::set::erase(iterator,iterator) where the iterator comes from another set, causing inconsistencies
This commit is contained in:
parent
12a9dc5a79
commit
6008599f02
@ -415,7 +415,15 @@ bool p3GxsCircles::revokeIdsFromCircle( const std::set<RsGxsId>& identities, con
|
||||
return false;
|
||||
}
|
||||
|
||||
circleGrp.mInvitedMembers.erase(identities.begin(), identities.end());
|
||||
// /!\ AVOID calling circleGrp.mInvitedMembers.erase(identities.begin(),identities.end()), because it is not the same set. Consequently
|
||||
// STL code would corrupt the structure of mInvitedMembers.
|
||||
|
||||
std::set<RsGxsId> new_invited_members;
|
||||
for(auto& gxs_id: circleGrp.mInvitedMembers)
|
||||
if(identities.find(gxs_id) == identities.end())
|
||||
new_invited_members.insert(gxs_id);
|
||||
|
||||
circleGrp.mInvitedMembers = new_invited_members;
|
||||
|
||||
return editCircle(circleGrp);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user