Home
last modified time | relevance | path

Searched hist:"764 b6312" (Results 1 – 1 of 1) sorted by relevance

/qemu/qom/
H A Dobject.c764b6312 Fri Nov 23 08:47:12 GMT 2012 Paolo Bonzini <pbonzini@redhat.com> qom: fix refcount of non-heap-allocated objects

The reference count for embedded objects is always one too low, because
object_initialize_with_type returns with zero references to the object.
This causes premature finalization of the object (or an assertion failure)
after calling object_ref to add an extra reference and object_unref to
remove it.

The fix is to move the initial object_ref call from object_new_with_type
to object_initialize_with_type.

Acked-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>