diff --git a/src/Gui/Tree.cpp b/src/Gui/Tree.cpp index 1498724dfa..c029ed43fc 100644 --- a/src/Gui/Tree.cpp +++ b/src/Gui/Tree.cpp @@ -3155,11 +3155,13 @@ void TreeWidget::_slotDeleteObject(const Gui::ViewProviderDocumentObject& view, if(obj->getDocument() == doc) docItem->_ParentMap.erase(obj); + bool lock = blockConnection(true); for(auto cit=items.begin(),citNext=cit;cit!=items.end();cit=citNext) { ++citNext; (*cit)->myOwner = 0; delete *cit; } + blockConnection(lock); // Check for any child of the deleted object that is not in the tree, and put it // under document item.