qom: Remove parent pointer when unparenting
authorPeter Crosthwaite <peter.crosthwaite@xilinx.com>
Tue, 27 May 2014 00:39:51 +0000 (17:39 -0700)
committerAndreas Färber <afaerber@suse.de>
Mon, 30 Jun 2014 19:13:30 +0000 (21:13 +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: Andreas Färber <afaerber@suse.de>
qom/object.c

index 3876618c2e500c9c152f1b60da88324a6a1ea650..7cefdf2137a1e64a74c064d013b6232ef15c6dcc 100644 (file)
@@ -402,6 +402,7 @@ void object_unparent(Object *obj)
     }
     if (obj->parent) {
         object_property_del_child(obj->parent, obj, NULL);
+        obj->parent = NULL;
     }
     object_unref(obj);
 }