]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #2715: Make update of Object Browser only after operation finished
authorvsv <vsv@opencascade.com>
Wed, 24 Oct 2018 13:17:58 +0000 (16:17 +0300)
committervsv <vsv@opencascade.com>
Wed, 24 Oct 2018 13:17:58 +0000 (16:17 +0300)
src/ModuleBase/ModuleBase_OperationFeature.cpp
src/SketchPlugin/SketchPlugin_SketchEntity.h

index 5ec2646d2d16635e5743912bae8facc91bafa4a8..a1346ebc870ad2d6cf5279e2906c8d998ae77c9e 100755 (executable)
@@ -355,13 +355,13 @@ bool ModuleBase_OperationFeature::commit()
     commitOperation();
 
     stopOperation();
-    emit stopped();
-    emit committed();
 
-    // finishOperation has to be after commited because in signal commited
-    // there is a modification of attribures (color)
     SessionPtr aMgr = ModelAPI_Session::get();
     aMgr->finishOperation();
+    // Finish operation has to be before stopped because stopped caused update of Object browser
+    // If it will be done before of cleaning of obsolete objects it will cause crash
+    emit stopped();
+    emit committed();
 
     afterCommitOperation();
 #ifdef DEBUG_OPERATION_START
index 78a0429d7a82b4ed352fb647d863e8c7e2efc1fb..baa37b9d8f5ba1ba3ca64aea7924c8e670e10b07 100644 (file)
@@ -25,6 +25,7 @@
 #include "SketchPlugin_Feature.h"
 
 #include <ModelAPI_CompositeFeature.h>
+#include <ModelAPI_Session.h>
 #include <GeomAPI_Shape.h>
 #include <GeomAPI_AISObject.h>
 #include <ModelAPI_Document.h>
@@ -152,7 +153,7 @@ class SketchPlugin_SketchEntity : public SketchPlugin_Feature, public GeomAPI_IC
       aColor = Config_PropManager::color("Visualization", "sketch_entity_color");
     }
     if (!aColor.empty()) {
-      if (theResult.get()) {
+      if (theResult.get() && ModelAPI_Session::get()->isOperation()) {
         AttributeIntArrayPtr aColorAttr = theResult->data()->intArray(ModelAPI_Result::COLOR_ID());
         aColorAttr->setSize(3);
         // Set the color attribute in order do not use default colors in the perasentation object