]> git.proxmox.com Git - mirror_qemu.git/commitdiff
qom: object: remove parent pointer when unparenting
authorPeter Crosthwaite <peter.crosthwaite@xilinx.com>
Tue, 27 May 2014 00:39:51 +0000 (17:39 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 1 Jul 2014 08:20:41 +0000 (10:20 +0200)
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: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
qom/object.c

index f49335f0cfc41504d83690783244b199ba8ff77d..d5de8f6062e90e17e13b3fa53d5c4a84ea1ea0e9 100644 (file)
@@ -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);
 }