queue[2]: Unref events if the parent element disappeared

This commit is contained in:
Sebastian Dröge 2011-04-08 14:56:37 +02:00
parent d5485786a4
commit 1dac816e9c
2 changed files with 8 additions and 4 deletions

View file

@ -1285,9 +1285,11 @@ gst_queue_handle_src_event (GstPad * pad, GstEvent * event)
{ {
gboolean res = TRUE; gboolean res = TRUE;
GstQueue *queue = GST_QUEUE (gst_pad_get_parent (pad)); GstQueue *queue = GST_QUEUE (gst_pad_get_parent (pad));
if (G_UNLIKELY (queue == NULL))
return FALSE;
if (G_UNLIKELY (queue == NULL)) {
gst_event_unref (event);
return FALSE;
}
#ifndef GST_DISABLE_GST_DEBUG #ifndef GST_DISABLE_GST_DEBUG
GST_CAT_DEBUG_OBJECT (queue_dataflow, queue, "got event %p (%d)", GST_CAT_DEBUG_OBJECT (queue_dataflow, queue, "got event %p (%d)",
event, GST_EVENT_TYPE (event)); event, GST_EVENT_TYPE (event));

View file

@ -2365,9 +2365,11 @@ gst_queue2_handle_src_event (GstPad * pad, GstEvent * event)
{ {
gboolean res = TRUE; gboolean res = TRUE;
GstQueue2 *queue = GST_QUEUE2 (gst_pad_get_parent (pad)); GstQueue2 *queue = GST_QUEUE2 (gst_pad_get_parent (pad));
if (G_UNLIKELY (queue == NULL))
return FALSE;
if (G_UNLIKELY (queue == NULL)) {
gst_event_unref (event);
return FALSE;
}
#ifndef GST_DISABLE_GST_DEBUG #ifndef GST_DISABLE_GST_DEBUG
GST_CAT_DEBUG_OBJECT (queue_dataflow, queue, "got event %p (%s)", GST_CAT_DEBUG_OBJECT (queue_dataflow, queue, "got event %p (%s)",
event, GST_EVENT_TYPE_NAME (event)); event, GST_EVENT_TYPE_NAME (event));