mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
qdev: move bus removal to object_unparent
Add an ObjectClass method that is done at object_unparent time. It should remove any backlinks to the object in the composition tree, so that object_delete will be able to drop the last reference and free the object. Use it for qdev buses. Reviewed-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
764b63125a
commit
667d22d1ae
3 changed files with 27 additions and 3 deletions
|
@ -363,6 +363,9 @@ void object_unparent(Object *obj)
|
|||
if (obj->parent) {
|
||||
object_property_del_child(obj->parent, obj, NULL);
|
||||
}
|
||||
if (obj->class->unparent) {
|
||||
(obj->class->unparent)(obj);
|
||||
}
|
||||
}
|
||||
|
||||
static void object_deinit(Object *obj, TypeImpl *type)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue