From 1db50526e709237ae535aedbbefc2e5b4ab30f67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Stadler?= Date: Mon, 17 Oct 2011 21:38:56 +0200 Subject: [PATCH] tests: fix padtemplate leak in selector test In 0.11, gst_pad_get_pad_template returns a reference. --- tests/check/elements/selector.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/check/elements/selector.c b/tests/check/elements/selector.c index b4fee5d614..0d43ff7e29 100644 --- a/tests/check/elements/selector.c +++ b/tests/check/elements/selector.c @@ -545,6 +545,7 @@ GST_START_TEST (test_output_selector_getcaps_active); for (walker = output_pads; walker; walker = g_list_next (walker)) { GstCaps *caps; GstPad *pad; + GstPadTemplate *templ; pad = gst_pad_get_peer ((GstPad *) walker->data); @@ -553,13 +554,14 @@ GST_START_TEST (test_output_selector_getcaps_active); /* in 'active' mode, the active srcpad peer's caps should be returned on * the sinkpad's getcaps */ - expected = gst_pad_template_get_caps (gst_pad_get_pad_template ((GstPad *) - walker->data)); + templ = gst_pad_get_pad_template ((GstPad *) walker->data); + expected = gst_pad_template_get_caps (templ); caps = gst_pad_peer_get_caps (input_pad, NULL); g_assert (gst_caps_is_equal (caps, expected)); gst_caps_unref (caps); gst_caps_unref (expected); + gst_object_unref (templ); gst_object_unref (pad); }