From 1dac816e9c6cb2f87fb1c14d13ecc3d8433e5d20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Fri, 8 Apr 2011 14:56:37 +0200 Subject: [PATCH] queue[2]: Unref events if the parent element disappeared --- plugins/elements/gstqueue.c | 6 ++++-- plugins/elements/gstqueue2.c | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/plugins/elements/gstqueue.c b/plugins/elements/gstqueue.c index 8242559fce..e9e79f4f17 100644 --- a/plugins/elements/gstqueue.c +++ b/plugins/elements/gstqueue.c @@ -1285,9 +1285,11 @@ gst_queue_handle_src_event (GstPad * pad, GstEvent * event) { gboolean res = TRUE; 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 GST_CAT_DEBUG_OBJECT (queue_dataflow, queue, "got event %p (%d)", event, GST_EVENT_TYPE (event)); diff --git a/plugins/elements/gstqueue2.c b/plugins/elements/gstqueue2.c index 64b9afbb43..0a2b28c0dd 100644 --- a/plugins/elements/gstqueue2.c +++ b/plugins/elements/gstqueue2.c @@ -2365,9 +2365,11 @@ gst_queue2_handle_src_event (GstPad * pad, GstEvent * event) { gboolean res = TRUE; 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 GST_CAT_DEBUG_OBJECT (queue_dataflow, queue, "got event %p (%s)", event, GST_EVENT_TYPE_NAME (event));