]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Fix for import/export features
authormpv <mpv@opencascade.com>
Tue, 30 Jun 2015 10:51:35 +0000 (13:51 +0300)
committermpv <mpv@opencascade.com>
Tue, 30 Jun 2015 10:51:35 +0000 (13:51 +0300)
src/Model/Model_Update.cpp

index 5aa0e18f78011bec544c9dc047800a4abb813457..1572d8f3a3671f876eeecf35ef0130cbd110351a 100644 (file)
@@ -114,7 +114,7 @@ void Model_Update::processEvent(const std::shared_ptr<Events_Message>& theMessag
   if (isOperationChanged) {
     // remove all macros before clearing all created and execute all not-previewed
     std::set<ObjectPtr>::iterator anUpdatedIter = myJustUpdated.begin();
-    for(; anUpdatedIter != myJustUpdated.end(); anUpdatedIter++) {
+    while(anUpdatedIter != myJustUpdated.end()) {
       FeaturePtr aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(*anUpdatedIter);
       if (aFeature.get()) {
         // execute not-previewed feature on "apply"
@@ -126,8 +126,14 @@ void Model_Update::processEvent(const std::shared_ptr<Events_Message>& theMessag
         }
         // remove macro on apply
         if (aFeature->isMacro()) {
+          myJustUpdated.erase(aFeature); // to avoid the map update problems on "remove"
           aFeature->document()->removeFeature(aFeature);
+          anUpdatedIter = myJustUpdated.begin();
+        } else {
+          anUpdatedIter++;
         }
+      } else {
+        anUpdatedIter++;
       }
     }
     myIsParamUpdated = false;