]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #591 - Highlight of the first argument of constraints
authornds <natalia.donis@opencascade.com>
Tue, 7 Jul 2015 14:51:43 +0000 (17:51 +0300)
committernds <natalia.donis@opencascade.com>
Tue, 7 Jul 2015 14:55:09 +0000 (17:55 +0300)
create 8-9 lines(last are short), select last 6 lines with a rectangle. Call coincidence. Apply sketch leads to crash. Custom presentation asks the active sketch by the sketch redisplay in stopSketch operation. Current sketch is null, result is crash.

src/PartSet/PartSet_Module.cpp

index e43057089d3449665a6f7220c4fbaecb2bd8f159..631adfd17f3c26e54a0cb108837014d07a49df31 100644 (file)
@@ -285,16 +285,19 @@ void PartSet_Module::onOperationStarted(ModuleBase_Operation* theOperation)
 
 void PartSet_Module::onOperationStopped(ModuleBase_Operation* theOperation)
 {
+  // the custom presentation should be deactivated before stop sketch,
+  // because it uses the active sketch of the sketch manager without checking if it is not null
+  Handle(V3d_Viewer) aViewer = myWorkshop->viewer()->AISContext()->CurrentViewer();
+  aViewer->RemoveZLayer(myVisualLayerId);
+  myVisualLayerId = 0;
+  myCustomPrs->deactivate();
+
   if (PartSet_SketcherMgr::isSketchOperation(theOperation)) {
     mySketchMgr->stopSketch(theOperation);
   }
   else if (PartSet_SketcherMgr::isNestedSketchOperation(theOperation)) {
     mySketchMgr->stopNestedSketch(theOperation);
   }
-  Handle(V3d_Viewer) aViewer = myWorkshop->viewer()->AISContext()->CurrentViewer();
-  aViewer->RemoveZLayer(myVisualLayerId);
-  myVisualLayerId = 0;
-  myCustomPrs->deactivate();
 }
 
 ModuleBase_Operation* PartSet_Module::currentOperation() const