From: Sebastian Dröge Date: Fri, 8 Apr 2011 12:56:37 +0000 (+0200) Subject: queue[2]: Unref events if the parent element disappeared X-Git-Tag: RELEASE-0.10.33~215 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1dac816e9c6cb2f87fb1c14d13ecc3d8433e5d20;p=platform%2Fupstream%2Fgstreamer.git queue[2]: Unref events if the parent element disappeared --- diff --git a/plugins/elements/gstqueue.c b/plugins/elements/gstqueue.c index 8242559..e9e79f4 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 64b9afb..0a2b28c 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));