summaryrefslogtreecommitdiff
path: root/gst/gstbin.c
diff options
context:
space:
mode:
Diffstat (limited to 'gst/gstbin.c')
-rw-r--r--gst/gstbin.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gst/gstbin.c b/gst/gstbin.c
index 688988f5a..e1389cd19 100644
--- a/gst/gstbin.c
+++ b/gst/gstbin.c
@@ -1367,6 +1367,8 @@ adding_itself:
GST_OBJECT_LOCK (bin);
g_warning ("Cannot add bin '%s' to itself", GST_ELEMENT_NAME (bin));
GST_OBJECT_UNLOCK (bin);
+ gst_object_ref_sink (element);
+ gst_object_unref (element);
return FALSE;
}
duplicate_name:
@@ -1384,8 +1386,6 @@ had_parent:
g_warning ("Element '%s' already has parent", elem_name);
GST_OBJECT_UNLOCK (bin);
g_free (elem_name);
- gst_object_ref_sink (element);
- gst_object_unref (element);
return FALSE;
}
}