Merge remote-tracking branch 'origin/0.10'
[platform/upstream/gstreamer.git] / gst / gstbin.c
index 0ef7bd9..665259e 100644 (file)
@@ -1160,10 +1160,11 @@ no_state_recalc:
 
   GST_CAT_DEBUG_OBJECT (GST_CAT_PARENTAGE, bin, "added element \"%s\"",
       elem_name);
-  g_free (elem_name);
 
   g_signal_emit (bin, gst_bin_signals[ELEMENT_ADDED], 0, element);
-  gst_child_proxy_child_added ((GObject *) bin, (GObject *) element);
+  gst_child_proxy_child_added ((GObject *) bin, (GObject *) element, elem_name);
+
+  g_free (elem_name);
 
   return TRUE;
 
@@ -1480,7 +1481,6 @@ no_state_recalc:
 
   GST_CAT_INFO_OBJECT (GST_CAT_PARENTAGE, bin, "removed child \"%s\"",
       elem_name);
-  g_free (elem_name);
 
   gst_element_set_bus (element, NULL);
 
@@ -1497,8 +1497,10 @@ no_state_recalc:
   GST_OBJECT_UNLOCK (element);
 
   g_signal_emit (bin, gst_bin_signals[ELEMENT_REMOVED], 0, element);
-  gst_child_proxy_child_removed ((GObject *) bin, (GObject *) element);
+  gst_child_proxy_child_removed ((GObject *) bin, (GObject *) element,
+      elem_name);
 
+  g_free (elem_name);
   /* element is really out of our control now */
   gst_object_unref (element);