gst/gstobject.c: Unref the GEnumClass after usage again. Fixes bug #561501.
authorAndrew Feren <acferen@yahoo.com>
Wed, 19 Nov 2008 12:20:03 +0000 (12:20 +0000)
committerSebastian Dröge <slomo@circular-chaos.org>
Wed, 19 Nov 2008 12:20:03 +0000 (12:20 +0000)
Original commit message from CVS:
Patch by: Andrew Feren <acferen at yahoo dot com>
* gst/gstobject.c: (gst_object_default_deep_notify):
Unref the GEnumClass after usage again. Fixes bug #561501.

ChangeLog
gst/gstobject.c

index b34cd16..e5bbf1b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2008-11-19  Sebastian Dröge  <sebastian.droege@collabora.co.uk>
+
+       Patch by: Andrew Feren <acferen at yahoo dot com>
+
+       * gst/gstobject.c: (gst_object_default_deep_notify):
+       Unref the GEnumClass after usage again. Fixes bug #561501.
+
 2008-11-19  Wim Taymans  <wim.taymans@collabora.co.uk>
 
        * gst/gstbin.c: (_gst_boolean_accumulator), (gst_bin_class_init),
index aae86e7..10804cb 100644 (file)
@@ -571,13 +571,13 @@ gst_object_default_deep_notify (GObject * object, GstObject * orig,
     /* FIXME: handle flags */
     if (G_IS_PARAM_SPEC_ENUM (pspec)) {
       GEnumValue *enum_value;
+      GEnumClass *klass = G_ENUM_CLASS (g_type_class_ref (pspec->value_type));
 
-      enum_value =
-          g_enum_get_value (G_ENUM_CLASS (g_type_class_ref (pspec->value_type)),
-          g_value_get_enum (&value));
+      enum_value = g_enum_get_value (klass, g_value_get_enum (&value));
 
       str = g_strdup_printf ("%s (%d)", enum_value->value_nick,
           enum_value->value);
+      g_type_class_unref (klass);
     } else {
       str = g_strdup_value_contents (&value);
     }