Skip to content

Commit

Permalink
Gui: [skip ci] fix crash in DocumentObjectData::updateChildren() when…
Browse files Browse the repository at this point in the history
… canceling a pending task
  • Loading branch information
wwmayer committed Sep 16, 2020
1 parent 7a93bcb commit ff0f8b0
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/Gui/Tree.cpp
Expand Up @@ -322,11 +322,17 @@ class Gui::DocumentObjectData {
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
Expand Down

0 comments on commit ff0f8b0

Please sign in to comment.