Gui: [skip ci] fix crash in DocumentObjectData::updateChildren() when canceling a pending task

This commit is contained in:
wmayer
2020-09-16 13:41:03 +02:00
parent 7b34a43c16
commit c3354a46db

View File

@@ -322,11 +322,17 @@ public:
if (newSet.find(child) == newSet.end()) {
// this means old child removed
updated = true;
docItem->_ParentMap[child].erase(obj);
auto mapIt = docItem->_ParentMap.find(child);
auto childVp = docItem->getViewProvider(child);
if (childVp && child->getDocument() == obj->getDocument())
childVp->setShowable(docItem->isObjectShowable(child));
// If 'child' is not part of the map then it has already been deleted
// in _slotDeleteObject.
if (mapIt != docItem->_ParentMap.end()) {
docItem->_ParentMap[child].erase(obj);
auto childVp = docItem->getViewProvider(child);
if (childVp && child->getDocument() == obj->getDocument())
childVp->setShowable(docItem->isObjectShowable(child));
}
}
}
// We still need to check the order of the children