If a function takes a floating reference and sinks it, it should also do
that in error cases. I.e. call ref_sink() followed by unref().
Otherwise the reference counting behaviour of the function will be
different between the good and the error case, and simply inconsistent.
https://bugzilla.gnome.org/show_bug.cgi?id=747990
elem_name, GST_ELEMENT_NAME (bin));
GST_OBJECT_UNLOCK (bin);
g_free (elem_name);
+ gst_object_ref_sink (element);
+ gst_object_unref (element);
return FALSE;
}
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;
}
}
{
g_warning ("adding elements to bin '%s' is not supported",
GST_ELEMENT_NAME (bin));
+ 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;
}
had_parent:
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:
{
GST_CAT_DEBUG_OBJECT (GST_CAT_REFCOUNTING, object,
"set parent failed, object already had a parent");
+ gst_object_ref_sink (object);
+ gst_object_unref (object);
GST_OBJECT_UNLOCK (object);
return FALSE;
}