From b2edab940aa005ca79a2bde428881b0590f7a246 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Mon, 1 Jul 2024 09:24:28 +0200 Subject: [PATCH] gstreamer/gst-tester: Don't leak thread Part-of: --- subprojects/gstreamer/tests/validate/gst-tester.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/subprojects/gstreamer/tests/validate/gst-tester.c b/subprojects/gstreamer/tests/validate/gst-tester.c index 2ab4865f49..bebdaefb86 100644 --- a/subprojects/gstreamer/tests/validate/gst-tester.c +++ b/subprojects/gstreamer/tests/validate/gst-tester.c @@ -156,6 +156,7 @@ main (int argc, gchar ** argv) GError *err = NULL; gchar *filename; gboolean is_tty = isatty (STDOUT_FILENO); + GThread *thread; if (argc < 2) { g_print ("1..0\nnot ok # Missing argument\n"); @@ -210,9 +211,10 @@ main (int argc, gchar ** argv) /* Running the subprocess in it own thread so that we can properly catch * interuptions in the main thread main loop */ - g_thread_new ("gst-tester-thread", (GThreadFunc) _run_app, &app); + thread = g_thread_new ("gst-tester-thread", (GThreadFunc) _run_app, &app); g_main_loop_run (app.ml); g_main_loop_unref (app.ml); + g_thread_join (thread); g_strfreev (args); return app.exitcode;