From: eap Date: Wed, 26 Jan 2005 09:07:48 +0000 (+0000) Subject: In Split(), fix removal from a set being iterated, leading to exception at study... X-Git-Tag: V2_2_0b2~21 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=71bc953009d275a48e997446bda1d14c6b570c16;p=modules%2Fsmesh.git In Split(), fix removal from a set being iterated, leading to exception at study restoration if there are intersecting groups --- diff --git a/src/DriverMED/DriverMED_Family.cxx b/src/DriverMED/DriverMED_Family.cxx index 34ff2c20b..d9ff5b249 100644 --- a/src/DriverMED/DriverMED_Family.cxx +++ b/src/DriverMED/DriverMED_Family.cxx @@ -350,14 +350,16 @@ void DriverMED_Family::Split (DriverMED_FamilyPtr by, { // Elements set::iterator anIter = by->myElements.begin(); - for (; anIter != by->myElements.end(); anIter++) + while ( anIter != by->myElements.end()) { if (myElements.find(*anIter) != myElements.end()) { common->myElements.insert(*anIter); myElements.erase(*anIter); - by->myElements.erase(*anIter); + by->myElements.erase(anIter++); } + else + anIter++; } if (!common->IsEmpty())