qom: 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: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
This commit is contained in:
Peter Crosthwaite 2014-05-26 17:39:51 -07:00 committed by Andreas Färber
parent 53a259da56
commit d15ae221ea
1 changed files with 1 additions and 0 deletions

View 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);
}