Commit 565158bb authored by Marco Bubke's avatar Marco Bubke Committed by Kai Koehne
Browse files

Always reset the id for an object in node instances

Because we tested for the parent, the id of a root item never reset.
This was hidden because if you remove a root item all
child items was removed too. But if the object was not deleted by the
root item and there was a binding the root item id, there was a dangling

Task-Number: BAUHAUS-662
Reviewed-by: kkoehne
parent 628375a5
......@@ -123,8 +123,9 @@ void ObjectNodeInstance::destroy()
if (deleteHeldInstance()) {
// Remove from old property
if (object() && modelNode().isValid() && modelNode().parentProperty().isValid()) {
if (object()) {
if (modelNode().isValid() && modelNode().parentProperty().isValid()) {
NodeAbstractProperty parentProperty = modelNode().parentProperty();
ModelNode parentNode = parentProperty.parentModelNode();
if (parentNode.isValid() && nodeInstanceView()->hasInstanceForNode(parentNode)) {
......@@ -132,6 +133,7 @@ void ObjectNodeInstance::destroy()
reparent(parentInstance,, NodeInstance() , QString());
if (object()) {
QObject *obj = object();
Markdown is supported
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