Core: Do not detach object from document before the call of breakDependency
This fixes #17900
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user