From 6239c1880d74ea741d49e06ab9d24b1d9e63a0dc Mon Sep 17 00:00:00 2001 From: nds Date: Tue, 7 Jul 2015 17:51:43 +0300 Subject: [PATCH] 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. --- src/PartSet/PartSet_Module.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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 -- 2.39.2