From bbf5548899be31fa8313b27b62e7324776b36823 Mon Sep 17 00:00:00 2001 From: wmayer Date: Sun, 6 Nov 2016 15:09:42 +0100 Subject: [PATCH] break dependency to deleted object on rollback --- src/App/Document.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/App/Document.cpp b/src/App/Document.cpp index ab1fc9258..9e6a98e8d 100644 --- a/src/App/Document.cpp +++ b/src/App/Document.cpp @@ -2087,7 +2087,7 @@ void Document::remObject(const char* sName) breakDependency(pos->second, true); //and remove the tip if needed - if(Tip.getValue() && strcmp(Tip.getValue()->getNameInDocument(), sName)==0) { + if (Tip.getValue() && strcmp(Tip.getValue()->getNameInDocument(), sName)==0) { Tip.setValue(nullptr); TipName.setValue(""); } @@ -2145,16 +2145,15 @@ void Document::_remObject(DocumentObject* pcObject) } // do no transactions if we do a rollback! - if (!d->rollback) { + if (!d->rollback && d->activeUndoTransaction) { // Undo stuff - if (d->activeUndoTransaction) { - signalTransactionRemove(*pcObject, d->activeUndoTransaction); - d->activeUndoTransaction->addObjectNew(pcObject); - } + signalTransactionRemove(*pcObject, d->activeUndoTransaction); + d->activeUndoTransaction->addObjectNew(pcObject); } else { // for a rollback delete the object signalTransactionRemove(*pcObject, 0); + breakDependency(pcObject, true); } // remove from map