From 60855dd590f9054e50dd1bd36aa0b984ee97b02a Mon Sep 17 00:00:00 2001 From: nds Date: Wed, 8 Apr 2015 10:35:18 +0300 Subject: [PATCH] The crash is: click Sketch feature, abort(without plane selection), click Sketch feature, chose the plane, create a triangle by lines, select a last point ->crash. The reason is not deactivated face validator of widget sketch label. --- src/ModuleBase/ModuleBase_FilterValidated.cpp | 4 +++- src/PartSet/PartSet_WidgetSketchLabel.cpp | 1 + src/XGUI/XGUI_Displayer.cpp | 4 +++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/ModuleBase/ModuleBase_FilterValidated.cpp b/src/ModuleBase/ModuleBase_FilterValidated.cpp index a6336d353..5bb26dac5 100644 --- a/src/ModuleBase/ModuleBase_FilterValidated.cpp +++ b/src/ModuleBase/ModuleBase_FilterValidated.cpp @@ -18,8 +18,10 @@ IMPLEMENT_STANDARD_RTTIEXT(ModuleBase_FilterValidated, SelectMgr_Filter); Standard_Boolean ModuleBase_FilterValidated::IsOk(const Handle(SelectMgr_EntityOwner)& theOwner) const { ModuleBase_Operation* anOperation = myWorkshop->module()->currentOperation(); - ModuleBase_IPropertyPanel* aPanel = anOperation->propertyPanel(); + if (!anOperation) + return true; + ModuleBase_IPropertyPanel* aPanel = anOperation->propertyPanel(); ModuleBase_ModelWidget* anActiveWidget = aPanel->activeWidget(); ModuleBase_WidgetValidated* aWidgetValidated = dynamic_cast (anActiveWidget); diff --git a/src/PartSet/PartSet_WidgetSketchLabel.cpp b/src/PartSet/PartSet_WidgetSketchLabel.cpp index 6be038d19..af8e9d56a 100644 --- a/src/PartSet/PartSet_WidgetSketchLabel.cpp +++ b/src/PartSet/PartSet_WidgetSketchLabel.cpp @@ -245,6 +245,7 @@ void PartSet_WidgetSketchLabel::deactivate() //XGUI_Displayer* aDisp = myWorkshop->displayer(); //aDisp->closeLocalContexts(); erasePreviewPlanes(); + activateFilters(myWorkshop->module()->workshop(), false); } void PartSet_WidgetSketchLabel::erasePreviewPlanes() diff --git a/src/XGUI/XGUI_Displayer.cpp b/src/XGUI/XGUI_Displayer.cpp index cbe4bb8fe..57cb49801 100644 --- a/src/XGUI/XGUI_Displayer.cpp +++ b/src/XGUI/XGUI_Displayer.cpp @@ -706,7 +706,9 @@ void XGUI_Displayer::removeSelectionFilter(const Handle(SelectMgr_Filter)& theFi Handle(AIS_InteractiveContext) aContext = AISContext(); if (aContext.IsNull()) return; - GetFilter()->Remove(theFilter); + Handle(SelectMgr_AndFilter) aCompositeFilter = GetFilter(); + if (aCompositeFilter->IsIn(theFilter)) + aCompositeFilter->Remove(theFilter); } void XGUI_Displayer::removeFilters() -- 2.39.2