From 360ce564c33d7e20ba96d6092b8656997c8807e7 Mon Sep 17 00:00:00 2001 From: vsv Date: Wed, 15 Jul 2015 19:27:02 +0300 Subject: [PATCH] Prevent crash on deletion of several features by a one command --- src/ModuleBase/ModuleBase_WidgetFactory.cpp | 2 +- src/XGUI/XGUI_Workshop.cpp | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) 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; -- 2.39.2