From b05eeb9df4f5ea1bb99713d4795c92bd870cf088 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim-Philipp=20M=C3=BCller?= Date: Sat, 14 Jun 2014 11:31:44 +0100 Subject: [PATCH] flowcombiner: keep a ref to the pads we're using Needed for use via the boxed type. https://bugzilla.gnome.org/show_bug.cgi?id=731355 --- libs/gst/base/gstflowcombiner.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/libs/gst/base/gstflowcombiner.c b/libs/gst/base/gstflowcombiner.c index 7eaa63f..028f6e0 100644 --- a/libs/gst/base/gstflowcombiner.c +++ b/libs/gst/base/gstflowcombiner.c @@ -129,7 +129,11 @@ gst_flow_combiner_unref (GstFlowCombiner * combiner) g_return_if_fail (combiner->ref_count > 0); if (g_atomic_int_dec_and_test (&combiner->ref_count)) { - g_queue_clear (&combiner->pads); + GstPad *pad; + + while ((pad = g_queue_pop_head (&combiner->pads))) + gst_object_unref (pad); + g_slice_free (GstFlowCombiner, combiner); } } @@ -219,7 +223,7 @@ gst_flow_combiner_add_pad (GstFlowCombiner * combiner, GstPad * pad) g_return_if_fail (combiner != NULL); g_return_if_fail (pad != NULL); - g_queue_push_head (&combiner->pads, pad); + g_queue_push_head (&combiner->pads, gst_object_ref (pad)); } /** @@ -237,5 +241,6 @@ gst_flow_combiner_remove_pad (GstFlowCombiner * combiner, GstPad * pad) g_return_if_fail (combiner != NULL); g_return_if_fail (pad != NULL); - g_queue_remove (&combiner->pads, pad); + if (g_queue_remove (&combiner->pads, pad)) + gst_object_unref (pad); } -- 2.7.4