diff mbox

[PULL,1/5] qom: Remove parent pointer when unparenting

Message ID 1404184093-966-2-git-send-email-afaerber@suse.de
State New
Headers show

Commit Message

Andreas Färber July 1, 2014, 3:08 a.m. UTC
From: Peter Crosthwaite <peter.crosthwaite@xilinx.com>

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 | 1 +
 1 file changed, 1 insertion(+)
diff mbox

Patch

diff --git a/qom/object.c b/qom/object.c
index 3876618..7cefdf2 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -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);
 }