From 6a8c2685be3992d0aac0c54d12a3fb31dd198624 Mon Sep 17 00:00:00 2001 From: Marek Kasik Date: Thu, 22 May 2014 11:00:14 +0200 Subject: [PATCH] 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 --- gobject/gobject.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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); }