mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 16:50:47 +00:00
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
This commit is contained in:
parent
74177f9b6f
commit
94232da665
5 changed files with 11 additions and 5 deletions
|
@ -158,7 +158,6 @@ GST_START_TEST (test_pipeline)
|
||||||
bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline));
|
bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline));
|
||||||
gst_bus_add_signal_watch (bus);
|
gst_bus_add_signal_watch (bus);
|
||||||
g_signal_connect (G_OBJECT (bus), "message", G_CALLBACK (on_message), loop);
|
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,
|
fail_if (gst_element_set_state (pipeline,
|
||||||
GST_STATE_PLAYING) == GST_STATE_CHANGE_FAILURE);
|
GST_STATE_PLAYING) == GST_STATE_CHANGE_FAILURE);
|
||||||
|
@ -171,6 +170,8 @@ GST_START_TEST (test_pipeline)
|
||||||
fail_unless (gst_element_set_state (pipeline,
|
fail_unless (gst_element_set_state (pipeline,
|
||||||
GST_STATE_NULL) == GST_STATE_CHANGE_SUCCESS);
|
GST_STATE_NULL) == GST_STATE_CHANGE_SUCCESS);
|
||||||
|
|
||||||
|
gst_bus_remove_signal_watch (bus);
|
||||||
|
gst_object_unref (GST_OBJECT (bus));
|
||||||
g_main_loop_unref (loop);
|
g_main_loop_unref (loop);
|
||||||
gst_object_unref (pipeline);
|
gst_object_unref (pipeline);
|
||||||
}
|
}
|
||||||
|
|
|
@ -155,7 +155,6 @@ GST_START_TEST (test_pipeline)
|
||||||
bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline));
|
bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline));
|
||||||
gst_bus_add_signal_watch (bus);
|
gst_bus_add_signal_watch (bus);
|
||||||
g_signal_connect (G_OBJECT (bus), "message", G_CALLBACK (on_message), loop);
|
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,
|
fail_if (gst_element_set_state (pipeline,
|
||||||
GST_STATE_PLAYING) == GST_STATE_CHANGE_FAILURE);
|
GST_STATE_PLAYING) == GST_STATE_CHANGE_FAILURE);
|
||||||
|
@ -168,6 +167,8 @@ GST_START_TEST (test_pipeline)
|
||||||
fail_unless (gst_element_set_state (pipeline,
|
fail_unless (gst_element_set_state (pipeline,
|
||||||
GST_STATE_NULL) == GST_STATE_CHANGE_SUCCESS);
|
GST_STATE_NULL) == GST_STATE_CHANGE_SUCCESS);
|
||||||
|
|
||||||
|
gst_bus_remove_signal_watch (bus);
|
||||||
|
gst_object_unref (GST_OBJECT (bus));
|
||||||
g_main_loop_unref (loop);
|
g_main_loop_unref (loop);
|
||||||
gst_object_unref (pipeline);
|
gst_object_unref (pipeline);
|
||||||
}
|
}
|
||||||
|
|
|
@ -299,7 +299,6 @@ rtp_pipeline_run (rtp_pipeline * p)
|
||||||
bus = gst_pipeline_get_bus (GST_PIPELINE (p->pipeline));
|
bus = gst_pipeline_get_bus (GST_PIPELINE (p->pipeline));
|
||||||
|
|
||||||
gst_bus_add_watch (bus, rtp_bus_callback, (gpointer) mainloop);
|
gst_bus_add_watch (bus, rtp_bus_callback, (gpointer) mainloop);
|
||||||
gst_object_unref (bus);
|
|
||||||
|
|
||||||
/* Set pipeline to PLAYING. */
|
/* Set pipeline to PLAYING. */
|
||||||
gst_element_set_state (p->pipeline, GST_STATE_PLAYING);
|
gst_element_set_state (p->pipeline, GST_STATE_PLAYING);
|
||||||
|
@ -354,6 +353,9 @@ rtp_pipeline_run (rtp_pipeline * p)
|
||||||
/* Release mainloop. */
|
/* Release mainloop. */
|
||||||
g_main_loop_unref (mainloop);
|
g_main_loop_unref (mainloop);
|
||||||
|
|
||||||
|
gst_bus_remove_watch (bus);
|
||||||
|
gst_object_unref (bus);
|
||||||
|
|
||||||
fail_if (p->custom_event);
|
fail_if (p->custom_event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -163,7 +163,6 @@ GST_START_TEST (test_caps_transform)
|
||||||
fail_unless (bus != NULL);
|
fail_unless (bus != NULL);
|
||||||
|
|
||||||
gst_bus_add_watch (bus, bus_handler, loop);
|
gst_bus_add_watch (bus, bus_handler, loop);
|
||||||
gst_object_unref (bus);
|
|
||||||
|
|
||||||
conversions_test_size = G_N_ELEMENTS (conversion_table);
|
conversions_test_size = G_N_ELEMENTS (conversion_table);
|
||||||
for (itr = 0; itr < conversions_test_size; itr++) {
|
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");
|
"couldn't set pipeline to READY state");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gst_bus_remove_watch (bus);
|
||||||
|
gst_object_unref (bus);
|
||||||
g_main_loop_unref (loop);
|
g_main_loop_unref (loop);
|
||||||
|
|
||||||
videobox_test_deinit_context (&ctx);
|
videobox_test_deinit_context (&ctx);
|
||||||
|
|
|
@ -72,7 +72,6 @@ run_test (const gchar * pipeline_string)
|
||||||
|
|
||||||
g_signal_connect (bus, "message", (GCallback) on_message_cb, &omud);
|
g_signal_connect (bus, "message", (GCallback) on_message_cb, &omud);
|
||||||
|
|
||||||
gst_object_unref (bus);
|
|
||||||
|
|
||||||
ret = gst_element_set_state (pipeline, GST_STATE_PLAYING);
|
ret = gst_element_set_state (pipeline, GST_STATE_PLAYING);
|
||||||
fail_unless (ret == GST_STATE_CHANGE_SUCCESS
|
fail_unless (ret == GST_STATE_CHANGE_SUCCESS
|
||||||
|
@ -85,6 +84,8 @@ run_test (const gchar * pipeline_string)
|
||||||
|
|
||||||
fail_unless (omud.eos == TRUE);
|
fail_unless (omud.eos == TRUE);
|
||||||
|
|
||||||
|
gst_bus_remove_signal_watch (bus);
|
||||||
|
gst_object_unref (bus);
|
||||||
gst_object_unref (pipeline);
|
gst_object_unref (pipeline);
|
||||||
g_main_loop_unref (loop);
|
g_main_loop_unref (loop);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue