summaryrefslogtreecommitdiff
path: root/qjson.h
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2012-11-23 09:47:12 +0100
committerAnthony Liguori <aliguori@us.ibm.com>2012-11-26 13:41:00 -0600
commit764b63125a77dab54ed405d493452a4e05679c2e (patch)
treee87f9491b5d559fa6039f58e423494c86c4b0b49 /qjson.h
parentb5007bcc9729acd995518c52eb1038c4d8416b5d (diff)
downloadqemu-764b63125a77dab54ed405d493452a4e05679c2e.tar.gz
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>
Diffstat (limited to 'qjson.h')
0 files changed, 0 insertions, 0 deletions