From: nds Date: Tue, 7 Jul 2015 14:51:43 +0000 (+0300) Subject: Issue #591 - Highlight of the first argument of constraints X-Git-Tag: V_1.3.0~83 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=6239c1880d74ea741d49e06ab9d24b1d9e63a0dc;p=modules%2Fshaper.git Issue #591 - Highlight of the first argument of constraints 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. --- diff --git a/src/PartSet/PartSet_Module.cpp b/src/PartSet/PartSet_Module.cpp index e43057089..631adfd17 100644 --- a/src/PartSet/PartSet_Module.cpp +++ b/src/PartSet/PartSet_Module.cpp @@ -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