From: mpv Date: Wed, 24 Jun 2015 12:26:08 +0000 (+0300) Subject: Fix for crash of undo/redo of part creation X-Git-Tag: V_1.3.0~195 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=1f1f7f5dd7b157f8289c1ef0ffc2fb65a53a0884;p=modules%2Fshaper.git Fix for crash of undo/redo of part creation --- diff --git a/src/PartSetPlugin/PartSetPlugin_Part.cpp b/src/PartSetPlugin/PartSetPlugin_Part.cpp index 09a768acf..fda4e53a1 100644 --- a/src/PartSetPlugin/PartSetPlugin_Part.cpp +++ b/src/PartSetPlugin/PartSetPlugin_Part.cpp @@ -10,6 +10,7 @@ #include "ModelAPI_Data.h" #include "ModelAPI_AttributeDocRef.h" #include +#include using namespace std; @@ -30,6 +31,12 @@ void PartSetPlugin_Part::execute() // do not activate part by simple execution if it is not loaded yet: it must be explicitly // activated for this if (!ModelAPI_Session::get()->isLoadByDemand(aResult->data()->name())) { + // On undo/redo creation of the part result the Object Borwser must get creation event + // earlier that activation of this part event (otherwise the crash is producted) + // So, send a creation event earlier, without any grouping + static Events_ID aCreateID = Events_Loop::eventByName(EVENT_OBJECT_CREATED); + ModelAPI_EventCreator::get()->sendUpdated(aResult, aCreateID, false); + aResult->activate(); } }