From bf4f4d92dd943361f8a86405e9287fffc8af7d56 Mon Sep 17 00:00:00 2001 From: mpv Date: Tue, 30 Jun 2015 13:51:35 +0300 Subject: [PATCH] Fix for import/export features --- src/Model/Model_Update.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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; -- 2.39.2