mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 18:05:37 +00:00
element: call ->release_pad() to clean up pad
https://bugzilla.gnome.org/show_bug.cgi?id=636011 https://bugzilla.gnome.org/show_bug.cgi?id=402562
This commit is contained in:
parent
2d4edcf83f
commit
9048b4dc2a
1 changed files with 13 additions and 1 deletions
|
@ -316,6 +316,8 @@ gst_element_release_request_pad (GstElement * element, GstPad * pad)
|
|||
|
||||
g_return_if_fail (GST_IS_ELEMENT (element));
|
||||
g_return_if_fail (GST_IS_PAD (pad));
|
||||
g_return_if_fail (GST_PAD_TEMPLATE_PRESENCE (GST_PAD_PAD_TEMPLATE (pad))
|
||||
== GST_PAD_REQUEST);
|
||||
|
||||
oclass = GST_ELEMENT_GET_CLASS (element);
|
||||
|
||||
|
@ -2747,6 +2749,9 @@ gst_element_dispose (GObject * object)
|
|||
GstElement *element = GST_ELEMENT_CAST (object);
|
||||
GstClock **clock_p;
|
||||
GstBus **bus_p;
|
||||
GstElementClass *oclass;
|
||||
|
||||
oclass = GST_ELEMENT_GET_CLASS (element);
|
||||
|
||||
GST_CAT_INFO_OBJECT (GST_CAT_REFCOUNTING, element, "dispose");
|
||||
|
||||
|
@ -2757,7 +2762,14 @@ gst_element_dispose (GObject * object)
|
|||
"removing %d pads", g_list_length (element->pads));
|
||||
/* first we break all our links with the outside */
|
||||
while (element->pads && element->pads->data) {
|
||||
GstPad *pad = GST_PAD_CAST (element->pads->data);
|
||||
|
||||
/* don't call _remove_pad with NULL */
|
||||
if (oclass->release_pad && GST_PAD_PAD_TEMPLATE (pad) &&
|
||||
GST_PAD_TEMPLATE_PRESENCE (GST_PAD_PAD_TEMPLATE (pad))
|
||||
== GST_PAD_REQUEST)
|
||||
(oclass->release_pad) (element, GST_PAD_CAST (element->pads->data));
|
||||
else
|
||||
gst_element_remove_pad (element, GST_PAD_CAST (element->pads->data));
|
||||
}
|
||||
if (G_UNLIKELY (element->pads != NULL)) {
|
||||
|
|
Loading…
Reference in a new issue