Core: Do not detach object from document before the call of breakDependency

This fixes #17900
This commit is contained in:
wmayer
2024-11-18 19:01:00 +01:00
committed by Yorik van Havre
parent 9ec977f89d
commit eb3ce44b58

View File

@@ -3989,15 +3989,15 @@ void Document::_removeObject(DocumentObject* pcObject)
if (!d->rollback && d->activeUndoTransaction) {
// Undo stuff
signalTransactionRemove(*pcObject, d->activeUndoTransaction);
breakDependency(pcObject, true);
d->activeUndoTransaction->addObjectNew(pcObject);
}
else {
// for a rollback delete the object
signalTransactionRemove(*pcObject, 0);
breakDependency(pcObject, true);
}
breakDependency(pcObject, true);
// remove from map
pcObject->setStatus(ObjectStatus::Remove, false); // Unset the bit to be on the safe side
d->objectIdMap.erase(pcObject->_Id);