Am 25.01.2013 12:46, schrieb Paolo Bonzini:
> Avoid that the object disappears after it's deleted from the QOM
> composition tree, in case that was the only reference to it.
> 
> Signed-off-by: Paolo Bonzini <pbonz...@redhat.com>

Thought I had already added

Acked-by: Andreas Färber <afaer...@suse.de>

Andreas

> ---
>  qom/object.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/qom/object.c b/qom/object.c
> index 03e6f24..1a123da 100644
> --- a/qom/object.c
> +++ b/qom/object.c
> @@ -361,12 +361,14 @@ static void object_property_del_child(Object *obj, 
> Object *child, Error **errp)
>  
>  void object_unparent(Object *obj)
>  {
> +    object_ref(obj);
>      if (obj->parent) {
>          object_property_del_child(obj->parent, obj, NULL);
>      }
>      if (obj->class->unparent) {
>          (obj->class->unparent)(obj);
>      }
> +    object_unref(obj);
>  }
>  
>  static void object_deinit(Object *obj, TypeImpl *type)
> 


-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

Reply via email to