mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 00:33:55 -06:00
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: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
654a36d857
commit
c28322d10c
1 changed files with 1 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue