Skip to content

Commit

Permalink
qom: object: delete properties before calling instance_finalize
Browse files Browse the repository at this point in the history
This ensures that the children's unparent callback will still
have a usable parent.

Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
  • Loading branch information
bonzini committed Aug 17, 2014
1 parent 33cbb2c commit 76a6e1c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion qom/object.c
Original file line number Diff line number Diff line change
Expand Up @@ -418,8 +418,8 @@ static void object_finalize(void *data)
Object *obj = data;
TypeImpl *ti = obj->class->type;

object_deinit(obj, ti);
object_property_del_all(obj);
object_deinit(obj, ti);

g_assert(obj->ref == 0);
if (obj->free) {
Expand Down

0 comments on commit 76a6e1c

Please sign in to comment.