summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--qom/object.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/qom/object.c b/qom/object.c
index 2e18c9a4ed..662ff7e093 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -307,6 +307,7 @@ void object_initialize_with_type(void *data, TypeImpl *type)
memset(obj, 0, type->instance_size);
obj->class = type->class;
+ object_ref(obj);
QTAILQ_INIT(&obj->properties);
object_init_with_type(obj, type);
}
@@ -395,7 +396,6 @@ Object *object_new_with_type(Type type)
obj = g_malloc(type->instance_size);
object_initialize_with_type(obj, type);
- object_ref(obj);
return obj;
}