diff options
Diffstat (limited to 'qom/object.c')
-rw-r--r-- | qom/object.c | 36 |
1 files changed, 7 insertions, 29 deletions
diff --git a/qom/object.c b/qom/object.c index e73d70a993..f2ae6e6b2a 100644 --- a/qom/object.c +++ b/qom/object.c @@ -2175,11 +2175,10 @@ static void property_set_str(Object *obj, Visitor *v, const char *name, g_free(value); } -static void property_release_str(Object *obj, const char *name, - void *opaque) +static void property_release_data(Object *obj, const char *name, + void *opaque) { - StringProperty *prop = opaque; - g_free(prop); + g_free(opaque); } ObjectProperty * @@ -2195,7 +2194,7 @@ object_property_add_str(Object *obj, const char *name, return object_property_add(obj, name, "string", get ? property_get_str : NULL, set ? property_set_str : NULL, - property_release_str, + property_release_data, prop); } @@ -2252,13 +2251,6 @@ static void property_set_bool(Object *obj, Visitor *v, const char *name, prop->set(obj, value, errp); } -static void property_release_bool(Object *obj, const char *name, - void *opaque) -{ - BoolProperty *prop = opaque; - g_free(prop); -} - ObjectProperty * object_property_add_bool(Object *obj, const char *name, bool (*get)(Object *, Error **), @@ -2272,7 +2264,7 @@ object_property_add_bool(Object *obj, const char *name, return object_property_add(obj, name, "bool", get ? property_get_bool : NULL, set ? property_set_bool : NULL, - property_release_bool, + property_release_data, prop); } @@ -2321,13 +2313,6 @@ static void property_set_enum(Object *obj, Visitor *v, const char *name, prop->set(obj, value, errp); } -static void property_release_enum(Object *obj, const char *name, - void *opaque) -{ - EnumProperty *prop = opaque; - g_free(prop); -} - ObjectProperty * object_property_add_enum(Object *obj, const char *name, const char *typename, @@ -2344,7 +2329,7 @@ object_property_add_enum(Object *obj, const char *name, return object_property_add(obj, name, typename, get ? property_get_enum : NULL, set ? property_set_enum : NULL, - property_release_enum, + property_release_data, prop); } @@ -2411,13 +2396,6 @@ out_end: visit_end_struct(v, NULL); } -static void property_release_tm(Object *obj, const char *name, - void *opaque) -{ - TMProperty *prop = opaque; - g_free(prop); -} - ObjectProperty * object_property_add_tm(Object *obj, const char *name, void (*get)(Object *, struct tm *, Error **)) @@ -2428,7 +2406,7 @@ object_property_add_tm(Object *obj, const char *name, return object_property_add(obj, name, "struct tm", get ? property_get_tm : NULL, NULL, - property_release_tm, + property_release_data, prop); } |