2005-11-16 Thomas Vander Stichele <thomas at apestaart dot org>
+ * gst/glib-compat.c: (g_value_dup_gst_object):
+ * gst/glib-compat.h:
+ * gst/gstpad.c: (gst_pad_set_property):
+ use gst_object_ref when setting the pad template; this will
+ trigger the pad template leaks on GLib 2.6 and the slaves
+
+2005-11-16 Thomas Vander Stichele <thomas at apestaart dot org>
+
* gst/glib-compat.c: (gst_flags_get_first_value):
* gst/glib-compat.h:
* gst/gstregistryxml.c:
#include "config.h"
#include <glib.h>
-#if GLIB_CHECK_VERSION (2, 6, 0)
#include <glib/gstdio.h>
-#endif
#include <stdio.h>
#include <errno.h>
return NULL;
}
+
+/* Adapted from g_value_dup_object to use gst_object_ref */
+#include "gstobject.h"
+GObject *
+g_value_dup_gst_object (const GValue * value)
+{
+ GObject *o;
+
+ g_return_val_if_fail (G_VALUE_HOLDS_OBJECT (value), NULL);
+
+ o = value->data[0].v_pointer;
+ if (!o)
+ return NULL;
+ g_return_val_if_fail (GST_IS_OBJECT (o), NULL);
+ return gst_object_ref (o);
+}
GFlagsValue*
gst_flags_get_first_value (GFlagsClass *flags_class,
guint value);
+
+GObject*
+g_value_dup_gst_object (const GValue *value);
G_END_DECLS
#include "gstinfo.h"
#include "gsterror.h"
#include "gstvalue.h"
+#include "glib-compat.h"
GST_DEBUG_CATEGORY_STATIC (debug_dataflow);
#define GST_CAT_DEFAULT GST_CAT_PADS
break;
case PAD_PROP_TEMPLATE:
gst_pad_set_pad_template (GST_PAD_CAST (object),
- (GstPadTemplate *) g_value_dup_object (value));
+ (GstPadTemplate *) g_value_dup_gst_object (value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);