From: Guillaume Desmottes Date: Tue, 12 Jul 2016 14:45:36 +0000 (+0200) Subject: tests: fix bus leaks X-Git-Tag: 1.19.3~509^2~2625 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=94232da66554cc78029cdaffb059c0fa2e192475;p=platform%2Fupstream%2Fgstreamer.git tests: fix bus leaks gst_bus_add_signal_watch() takes a ref on the bus which should be released using gst_bus_remove_signal_watch(). https://bugzilla.gnome.org/show_bug.cgi?id=768739 --- diff --git a/tests/check/elements/audiofirfilter.c b/tests/check/elements/audiofirfilter.c index dd31e87..d8b452c 100644 --- a/tests/check/elements/audiofirfilter.c +++ b/tests/check/elements/audiofirfilter.c @@ -158,7 +158,6 @@ GST_START_TEST (test_pipeline) bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline)); gst_bus_add_signal_watch (bus); g_signal_connect (G_OBJECT (bus), "message", G_CALLBACK (on_message), loop); - gst_object_unref (GST_OBJECT (bus)); fail_if (gst_element_set_state (pipeline, GST_STATE_PLAYING) == GST_STATE_CHANGE_FAILURE); @@ -171,6 +170,8 @@ GST_START_TEST (test_pipeline) fail_unless (gst_element_set_state (pipeline, GST_STATE_NULL) == GST_STATE_CHANGE_SUCCESS); + gst_bus_remove_signal_watch (bus); + gst_object_unref (GST_OBJECT (bus)); g_main_loop_unref (loop); gst_object_unref (pipeline); } diff --git a/tests/check/elements/audioiirfilter.c b/tests/check/elements/audioiirfilter.c index 8faae79..af2c9d3 100644 --- a/tests/check/elements/audioiirfilter.c +++ b/tests/check/elements/audioiirfilter.c @@ -155,7 +155,6 @@ GST_START_TEST (test_pipeline) bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline)); gst_bus_add_signal_watch (bus); g_signal_connect (G_OBJECT (bus), "message", G_CALLBACK (on_message), loop); - gst_object_unref (GST_OBJECT (bus)); fail_if (gst_element_set_state (pipeline, GST_STATE_PLAYING) == GST_STATE_CHANGE_FAILURE); @@ -168,6 +167,8 @@ GST_START_TEST (test_pipeline) fail_unless (gst_element_set_state (pipeline, GST_STATE_NULL) == GST_STATE_CHANGE_SUCCESS); + gst_bus_remove_signal_watch (bus); + gst_object_unref (GST_OBJECT (bus)); g_main_loop_unref (loop); gst_object_unref (pipeline); } diff --git a/tests/check/elements/rtp-payloading.c b/tests/check/elements/rtp-payloading.c index 96a601e..dda9c42 100644 --- a/tests/check/elements/rtp-payloading.c +++ b/tests/check/elements/rtp-payloading.c @@ -299,7 +299,6 @@ rtp_pipeline_run (rtp_pipeline * p) bus = gst_pipeline_get_bus (GST_PIPELINE (p->pipeline)); gst_bus_add_watch (bus, rtp_bus_callback, (gpointer) mainloop); - gst_object_unref (bus); /* Set pipeline to PLAYING. */ gst_element_set_state (p->pipeline, GST_STATE_PLAYING); @@ -354,6 +353,9 @@ rtp_pipeline_run (rtp_pipeline * p) /* Release mainloop. */ g_main_loop_unref (mainloop); + gst_bus_remove_watch (bus); + gst_object_unref (bus); + fail_if (p->custom_event); } diff --git a/tests/check/elements/videobox.c b/tests/check/elements/videobox.c index ec4825a..2d26535 100644 --- a/tests/check/elements/videobox.c +++ b/tests/check/elements/videobox.c @@ -163,7 +163,6 @@ GST_START_TEST (test_caps_transform) fail_unless (bus != NULL); gst_bus_add_watch (bus, bus_handler, loop); - gst_object_unref (bus); conversions_test_size = G_N_ELEMENTS (conversion_table); for (itr = 0; itr < conversions_test_size; itr++) { @@ -200,6 +199,8 @@ GST_START_TEST (test_caps_transform) "couldn't set pipeline to READY state"); } + gst_bus_remove_watch (bus); + gst_object_unref (bus); g_main_loop_unref (loop); videobox_test_deinit_context (&ctx); diff --git a/tests/check/pipelines/effectv.c b/tests/check/pipelines/effectv.c index 6c25e4b..a14806e 100644 --- a/tests/check/pipelines/effectv.c +++ b/tests/check/pipelines/effectv.c @@ -72,7 +72,6 @@ run_test (const gchar * pipeline_string) g_signal_connect (bus, "message", (GCallback) on_message_cb, &omud); - gst_object_unref (bus); ret = gst_element_set_state (pipeline, GST_STATE_PLAYING); fail_unless (ret == GST_STATE_CHANGE_SUCCESS @@ -85,6 +84,8 @@ run_test (const gchar * pipeline_string) fail_unless (omud.eos == TRUE); + gst_bus_remove_signal_watch (bus); + gst_object_unref (bus); gst_object_unref (pipeline); g_main_loop_unref (loop); }