Re: [Qemu-devel] [PATCH 1.3 1/5] qom: fix refcount of non-heap-allocated objects

2012-11-26 Thread Paolo Bonzini
Il 26/11/2012 16:49, Anthony Liguori ha scritto: > But object_property_add_child() will take a reference. > When the parent object goes away, this will cause that reference to get > dropped and ultimately the child object to be destroyed. This is still wrong if you have: object_init(&obj->subob

Re: [Qemu-devel] [PATCH 1.3 1/5] qom: fix refcount of non-heap-allocated objects

2012-11-26 Thread Anthony Liguori
Paolo Bonzini writes: > 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 referen

Re: [Qemu-devel] [PATCH 1.3 1/5] qom: fix refcount of non-heap-allocated objects

2012-11-23 Thread Andreas Färber
Am 23.11.2012 09:47, schrieb Paolo Bonzini: > 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

[Qemu-devel] [PATCH 1.3 1/5] qom: fix refcount of non-heap-allocated objects

2012-11-23 Thread Paolo Bonzini
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