From 524d51ded66fe5497c268bd32ce6ade8a99e17d3 Mon Sep 17 00:00:00 2001 From: nds Date: Tue, 1 Mar 2016 17:32:05 +0300 Subject: [PATCH] #1347 Fatal error when rename group --- src/XGUI/XGUI_OperationMgr.cpp | 2 +- src/XGUI/XGUI_Workshop.cpp | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/XGUI/XGUI_OperationMgr.cpp b/src/XGUI/XGUI_OperationMgr.cpp index 533bb6adc..3e6c41223 100644 --- a/src/XGUI/XGUI_OperationMgr.cpp +++ b/src/XGUI/XGUI_OperationMgr.cpp @@ -667,7 +667,7 @@ bool XGUI_OperationMgr::onProcessDelete(QObject* theObject) XGUI_ObjectsBrowser* aBrowser = workshop()->objectBrowser(); QWidget* aViewPort = myWorkshop->viewer()->activeViewPort(); // property panel child object is processed to process delete performed on Apply button of PP - if (isChildObject(theObject, aBrowser) || + if (theObject == aBrowser->treeView() || isChildObject(theObject, aViewPort) || isPPChildObject) workshop()->deleteObjects(); diff --git a/src/XGUI/XGUI_Workshop.cpp b/src/XGUI/XGUI_Workshop.cpp index ab326f3df..cb56c3879 100755 --- a/src/XGUI/XGUI_Workshop.cpp +++ b/src/XGUI/XGUI_Workshop.cpp @@ -1436,6 +1436,11 @@ bool XGUI_Workshop::isDeleteFeatureWithReferences(const QObjectPtrList& theList, QStringList aPartFeatureNames; foreach (ObjectPtr aObj, theList) { FeaturePtr aFeature = ModelAPI_Feature::feature(aObj); + // invalid feature data means that the feature is already removed in model, + // we needn't process it. E.g. delete of feature from create operation. The operation abort + // will delete the operation + if (!aFeature->data()->isValid()) + continue; ResultPtr aFirstResult = aFeature->firstResult(); std::string aResultGroupName = aFirstResult->groupName(); if (aResultGroupName == ModelAPI_ResultPart::group()) -- 2.39.2