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

This fixes #17900
This commit is contained in:
wmayer
2024-11-25 11:25:31 -06:00
committed by Chris Hennes
parent 80ec1e00b9
commit a15134d79b
+2 -2
View File
@@ -3623,15 +3623,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);