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:
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;
}
}
pad_name, GST_ELEMENT_NAME (element));
GST_OBJECT_UNLOCK (element);
g_free (pad_name);
- gst_object_ref_sink (pad);
- gst_object_unref (pad);
return FALSE;
}
no_direction:
/* Found pad with the same name, replace and return */
if (strcmp (templ->name_template, padtempl->name_template) == 0) {
+ gst_object_ref_sink (padtempl);
gst_object_unref (padtempl);
template_list->data = templ;
return;
g_critical ("Could not set internal pad %s:%s",
GST_DEBUG_PAD_NAME (internal));
GST_OBJECT_UNLOCK (pad);
- gst_object_unref (internal);
return FALSE;
}
}
GST_WARNING_OBJECT (registry,
"Not replacing plugin because new one (%s) is blacklisted but for a different location than existing one (%s)",
plugin->filename, existing_plugin->filename);
+ /* Keep reference counting consistent */
+ gst_object_ref_sink (plugin);
gst_object_unref (plugin);
GST_OBJECT_UNLOCK (registry);
return FALSE;
if (!gst_element_add_pad ((GstElement *) parent, gpad)) {
g_warning ("Pad named %s already exists in element %s\n",
GST_OBJECT_NAME (gpad), GST_OBJECT_NAME (parent));
- gst_object_unref ((GstObject *) gpad);
GST_STATE_UNLOCK (parent);
return NULL;
}
if (!gst_bin_add (GST_BIN (parent), capsfilter)) {
GST_ERROR ("Could not add capsfilter");
- gst_object_unref (capsfilter);
gst_object_unref (parent);
return FALSE;
}