controlsource: sink the floating ref
authorStefan Sauer <ensonic@users.sf.net>
Mon, 30 Jan 2012 17:17:34 +0000 (18:17 +0100)
committerStefan Sauer <ensonic@users.sf.net>
Mon, 30 Jan 2012 17:18:28 +0000 (18:18 +0100)
control sources can be used on several control bindings.

gst/gstcontrolsource.c

index 6269dc4..b75c2ee 100644 (file)
@@ -58,9 +58,15 @@ GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFAULT);
 G_DEFINE_ABSTRACT_TYPE_WITH_CODE (GstControlSource, gst_control_source,
     GST_TYPE_OBJECT, _do_init);
 
+static GObject *gst_control_source_constructor (GType type,
+    guint n_construct_params, GObjectConstructParam * construct_params);
+
 static void
 gst_control_source_class_init (GstControlSourceClass * klass)
 {
+  GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+
+  gobject_class->constructor = gst_control_source_constructor;
 }
 
 static void
@@ -70,6 +76,20 @@ gst_control_source_init (GstControlSource * self)
   self->get_value_array = NULL;
 }
 
+static GObject *
+gst_control_source_constructor (GType type, guint n_construct_params,
+    GObjectConstructParam * construct_params)
+{
+  GObject *self;
+
+  self =
+      G_OBJECT_CLASS (gst_control_source_parent_class)->constructor (type,
+      n_construct_params, construct_params);
+  gst_object_ref_sink (self);
+
+  return self;
+}
+
 /**
  * gst_control_source_get_value:
  * @self: the #GstControlSource object