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
This commit is contained in:
Marek Kasik 2014-05-22 11:00:14 +02:00
parent ace7658b28
commit 6a8c2685be

View File

@ -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);
}