fix crash when saving a document after aborting a pending transaction

This commit is contained in:
wmayer
2016-08-31 17:58:55 +02:00
parent 9ef81d7d56
commit 6e284fc9ea
4 changed files with 22 additions and 0 deletions

View File

@@ -2135,6 +2135,10 @@ void Document::_remObject(DocumentObject* pcObject)
d->activeUndoTransaction->addObjectNew(pcObject);
}
}
else {
// for a rollback delete the object
signalTransactionRemove(*pcObject, 0);
}
// remove from map
d->objectMap.erase(pos);
@@ -2145,6 +2149,11 @@ void Document::_remObject(DocumentObject* pcObject)
break;
}
}
// for a rollback delete the object
if (d->rollback) {
delete pcObject;
}
}
void Document::breakDependency(DocumentObject* pcObject, bool clear)