Coverity: Use after free (_removeObject may delete the DocumentObject)

This commit is contained in:
wmayer
2020-07-19 11:17:44 +02:00
parent 36363b3f14
commit 89f997a289

View File

@@ -4394,7 +4394,7 @@ DocumentObject* Document::moveObject(DocumentObject* obj, bool recursive)
// True object move without copy is only safe when undo is off on both
// documents.
if(!recursive && !d->iUndoMode && !that->d->iUndoMode) {
if(!recursive && !d->iUndoMode && !that->d->iUndoMode && !that->d->rollback) {
// all object of the other document that refer to this object must be nullified
that->breakDependency(obj, false);
std::string objname = getUniqueObjectName(obj->getNameInDocument());