From: vsv Date: Wed, 15 Jul 2015 16:27:02 +0000 (+0300) Subject: Prevent crash on deletion of several features by a one command X-Git-Tag: V_1.4.0_beta4~459 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=360ce564c33d7e20ba96d6092b8656997c8807e7;p=modules%2Fshaper.git Prevent crash on deletion of several features by a one command --- diff --git a/src/ModuleBase/ModuleBase_WidgetFactory.cpp b/src/ModuleBase/ModuleBase_WidgetFactory.cpp index 2787b00ac..2e2290491 100644 --- a/src/ModuleBase/ModuleBase_WidgetFactory.cpp +++ b/src/ModuleBase/ModuleBase_WidgetFactory.cpp @@ -152,7 +152,7 @@ ModuleBase_ModelWidget* ModuleBase_WidgetFactory::createWidgetByType(const std:: result = myWorkshop->module()->createWidgetByType(theType, theParent, myWidgetApi, myParentId); #ifdef _DEBUG if (!result) { - qDebug("ModuleBase_WidgetFactory::fillWidget: find bad widget type"); + qDebug("ModuleBase_WidgetFactory::fillWidget: find bad widget type %s", theType.c_str()); } #endif } diff --git a/src/XGUI/XGUI_Workshop.cpp b/src/XGUI/XGUI_Workshop.cpp index 8aa17ceb6..0fdec6b58 100644 --- a/src/XGUI/XGUI_Workshop.cpp +++ b/src/XGUI/XGUI_Workshop.cpp @@ -1019,6 +1019,9 @@ void XGUI_Workshop::deleteObjects() if (!isActiveOperationAborted()) return; QObjectPtrList anObjects = mySelector->selection()->selectedObjects(); + // It is necessary to clear selection in order to avoid selection changed event during + // deleteion and negative consequences connected with processing of already deleted items + mySelector->clearSelection(); // check whether the object can be deleted. There should not be parts which are not loaded if (!XGUI_Tools::canRemoveOrRename(myMainWindow, anObjects)) return;