diff options
author | Marek Kasik <mkasik@redhat.com> | 2014-05-22 11:00:14 +0200 |
---|---|---|
committer | Marek Kasik <mkasik@redhat.com> | 2014-05-22 11:00:14 +0200 |
commit | 6a8c2685be3992d0aac0c54d12a3fb31dd198624 (patch) | |
tree | 97539005415a7549b2175c0c599c111d9083f62f | |
parent | ace7658b28642e8a5b9ffe54838ccb4847b1cc6b (diff) |
gobject: unref unused class
If g_type_class_ref() returns a class which is not
a GObjectClass we need to unref it before return in
object_interface_check_properties().
https://bugzilla.gnome.org/show_bug.cgi?id=706983
-rw-r--r-- | gobject/gobject.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gobject/gobject.c b/gobject/gobject.c index 78fe203e9..4a35cd065 100644 --- a/gobject/gobject.c +++ b/gobject/gobject.c @@ -1404,9 +1404,12 @@ object_interface_check_properties (gpointer check_data, class = g_type_class_ref (iface_class->g_instance_type); - if (!G_IS_OBJECT_CLASS (class)) + if (class == NULL) return; + if (!G_IS_OBJECT_CLASS (class)) + goto out; + pspecs = g_param_spec_pool_list (pspec_pool, iface_type, &n); while (n--) @@ -1537,6 +1540,7 @@ object_interface_check_properties (gpointer check_data, g_free (pspecs); + out: g_type_class_unref (class); } |