Commit c28322d1 authored by Peter Crosthwaite's avatar Peter Crosthwaite Committed by Paolo Bonzini
Browse files

qom: object: remove parent pointer when unparenting



Certain parts of the QOM framework test this pointer to determine if
an object is parented. Nuke it when the object is unparented to allow
for reuse of an object after unparenting.

Signed-off-by: default avatarPeter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent 654a36d8
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -397,6 +397,7 @@ void object_unparent(Object *obj)
    }
    if (obj->parent) {
        object_property_del_child(obj->parent, obj, NULL);
        obj->parent = NULL;
    }
    object_unref(obj);
}