From: mpv Date: Tue, 30 Jun 2015 10:51:35 +0000 (+0300) Subject: Fix for import/export features X-Git-Tag: V_1.3.0~151 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=bf4f4d92dd943361f8a86405e9287fffc8af7d56;p=modules%2Fshaper.git Fix for import/export features --- diff --git a/src/Model/Model_Update.cpp b/src/Model/Model_Update.cpp index 5aa0e18f7..1572d8f3a 100644 --- a/src/Model/Model_Update.cpp +++ b/src/Model/Model_Update.cpp @@ -114,7 +114,7 @@ void Model_Update::processEvent(const std::shared_ptr& theMessag if (isOperationChanged) { // remove all macros before clearing all created and execute all not-previewed std::set::iterator anUpdatedIter = myJustUpdated.begin(); - for(; anUpdatedIter != myJustUpdated.end(); anUpdatedIter++) { + while(anUpdatedIter != myJustUpdated.end()) { FeaturePtr aFeature = std::dynamic_pointer_cast(*anUpdatedIter); if (aFeature.get()) { // execute not-previewed feature on "apply" @@ -126,8 +126,14 @@ void Model_Update::processEvent(const std::shared_ptr& 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;