From 6ae9c23fa3d0f23fa186a0c7e4e1154929e211de Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Mon, 16 May 2016 17:31:58 +0200 Subject: [PATCH] fix buffer leaks in tests Need to call gst_check_drop_buffers() to release the buffers exchanged during the test. https://bugzilla.gnome.org/show_bug.cgi?id=766561 --- tests/check/elements/capssetter.c | 1 + tests/check/elements/icydemux.c | 1 + tests/check/elements/jpegenc.c | 1 + tests/check/elements/level.c | 1 + tests/check/elements/multifile.c | 1 + tests/check/elements/qtmux.c | 2 ++ tests/check/elements/rtprtx.c | 1 + tests/check/elements/udpsrc.c | 2 ++ 8 files changed, 10 insertions(+) diff --git a/tests/check/elements/capssetter.c b/tests/check/elements/capssetter.c index 17e563b..afaad41 100644 --- a/tests/check/elements/capssetter.c +++ b/tests/check/elements/capssetter.c @@ -61,6 +61,7 @@ cleanup_capssetter (GstElement * capssetter) { GST_DEBUG ("cleanup_capssetter"); + gst_check_drop_buffers (); gst_pad_set_active (mysrcpad, FALSE); gst_pad_set_active (mysinkpad, FALSE); gst_check_teardown_src_pad (capssetter); diff --git a/tests/check/elements/icydemux.c b/tests/check/elements/icydemux.c index 525e309..1a17e79 100644 --- a/tests/check/elements/icydemux.c +++ b/tests/check/elements/icydemux.c @@ -148,6 +148,7 @@ cleanup_icydemux (void) gst_object_unref (bus); bus = NULL; + gst_check_drop_buffers (); gst_check_teardown_src_pad (icydemux); if (sinkpad) gst_check_teardown_sink_pad (icydemux); diff --git a/tests/check/elements/jpegenc.c b/tests/check/elements/jpegenc.c index b774316..c191a7e 100644 --- a/tests/check/elements/jpegenc.c +++ b/tests/check/elements/jpegenc.c @@ -81,6 +81,7 @@ cleanup_jpegenc (GstElement * jpegenc) GST_DEBUG ("cleanup_jpegenc"); gst_element_set_state (jpegenc, GST_STATE_NULL); + gst_check_drop_buffers (); gst_pad_set_active (mysrcpad, FALSE); gst_pad_set_active (mysinkpad, FALSE); gst_check_teardown_sink_pad (jpegenc); diff --git a/tests/check/elements/level.c b/tests/check/elements/level.c index 33cde14..f05370f 100644 --- a/tests/check/elements/level.c +++ b/tests/check/elements/level.c @@ -241,6 +241,7 @@ GST_START_TEST (test_message_is_valid) gst_object_unref (bus); gst_element_set_state (level, GST_STATE_NULL); cleanup_level (level); + gst_check_drop_buffers (); } GST_END_TEST; diff --git a/tests/check/elements/multifile.c b/tests/check/elements/multifile.c index 68717dc..e7abffe 100644 --- a/tests/check/elements/multifile.c +++ b/tests/check/elements/multifile.c @@ -371,6 +371,7 @@ GST_START_TEST (test_multifilesrc_stop_index) gst_element_set_state (src, GST_STATE_NULL); + gst_check_drop_buffers (); gst_check_teardown_pad_by_name (src, "src"); gst_check_teardown_element (src); } diff --git a/tests/check/elements/qtmux.c b/tests/check/elements/qtmux.c index a552d43..4bc1402 100644 --- a/tests/check/elements/qtmux.c +++ b/tests/check/elements/qtmux.c @@ -577,6 +577,7 @@ GST_START_TEST (test_reuse) fail_unless (gst_pad_push_event (mysrcpad, gst_event_new_eos ()) == TRUE); cleanup_qtmux (qtmux, "video_%u"); + gst_check_drop_buffers (); } GST_END_TEST; @@ -879,6 +880,7 @@ test_average_bitrate_custom (const gchar * elementname, gst_element_set_state (qtmux, GST_STATE_NULL); gst_element_set_state (filesink, GST_STATE_NULL); + gst_check_drop_buffers (); gst_pad_set_active (mysrcpad, FALSE); teardown_src_pad (mysrcpad); gst_object_unref (filesink); diff --git a/tests/check/elements/rtprtx.c b/tests/check/elements/rtprtx.c index 841f426..d3c5c6a 100644 --- a/tests/check/elements/rtprtx.c +++ b/tests/check/elements/rtprtx.c @@ -138,6 +138,7 @@ cleanup_rtprtx (GstElement * rtprtxsend, GstElement * rtprtxreceive) g_list_free (inbuffers); inbuffers = NULL; + gst_check_drop_buffers (); gst_pad_set_active (srcpad, FALSE); gst_check_teardown_src_pad (rtprtxsend); gst_check_teardown_element (rtprtxsend); diff --git a/tests/check/elements/udpsrc.c b/tests/check/elements/udpsrc.c index 494e8eb..d3705eb 100644 --- a/tests/check/elements/udpsrc.c +++ b/tests/check/elements/udpsrc.c @@ -125,6 +125,7 @@ no_socket: gst_element_set_state (udpsrc, GST_STATE_NULL); + gst_check_drop_buffers (); gst_check_teardown_pad_by_name (udpsrc, "src"); gst_check_teardown_element (udpsrc); @@ -222,6 +223,7 @@ send_failure: gst_element_set_state (udpsrc, GST_STATE_NULL); + gst_check_drop_buffers (); gst_check_teardown_pad_by_name (udpsrc, "src"); gst_check_teardown_element (udpsrc); -- 2.7.4