Commit ad838797 authored by Ralf Habacker's avatar Ralf Habacker
Browse files

Fix coverity check CID 169655: (USE_AFTER_FREE)

Passing freed pointer "umlobject" as an argument to
"sigObjectRemoved".sigObjectRemoved.

The 'object removed' signal is now emitted before object destroying.

CCBUG:340646
parent 03513107
......@@ -1885,8 +1885,9 @@ void UMLDoc::removeUMLObject(UMLObject* umlobject, bool deleteObject)
}
} else {
if (type == UMLObject::ot_Association) {
UMLAssociation *a = (UMLAssociation *)umlobject;
UMLAssociation *a = umlobject->asUMLAssociation();
removeAssociation(a, false); // don't call setModified here, it's done below
emit sigObjectRemoved(umlobject);
if (deleteObject)
delete a;
} else {
......@@ -1921,13 +1922,13 @@ void UMLDoc::removeUMLObject(UMLObject* umlobject, bool deleteObject)
}
}
pkg->removeObject(umlobject);
emit sigObjectRemoved(umlobject);
if (deleteObject)
delete umlobject;
} else {
uError() << umlobject->name() << ": parent package is not set !";
}
}
emit sigObjectRemoved(umlobject);
}
setModified(true);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment