]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
In Split(), fix removal from a set being iterated, leading to exception at study...
authoreap <eap@opencascade.com>
Wed, 26 Jan 2005 09:07:48 +0000 (09:07 +0000)
committereap <eap@opencascade.com>
Wed, 26 Jan 2005 09:07:48 +0000 (09:07 +0000)
src/DriverMED/DriverMED_Family.cxx

index 34ff2c20ba0c0c9bbb22c36aa0ba2a98b3e9c43b..d9ff5b249dcc2f766d2e8b65fa093af45b8e520a 100644 (file)
@@ -350,14 +350,16 @@ void DriverMED_Family::Split (DriverMED_FamilyPtr by,
 {
   // Elements
   set<const SMDS_MeshElement *>::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())