gstreamer/gst-tester: Don't leak thread

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7123>
This commit is contained in:
Edward Hervey 2024-07-01 09:24:28 +02:00 committed by Backport Bot
parent a8cf222cd0
commit 869b122e6b

View file

@ -156,6 +156,7 @@ main (int argc, gchar ** argv)
GError *err = NULL; GError *err = NULL;
gchar *filename; gchar *filename;
gboolean is_tty = isatty (STDOUT_FILENO); gboolean is_tty = isatty (STDOUT_FILENO);
GThread *thread;
if (argc < 2) { if (argc < 2) {
g_print ("1..0\nnot ok # Missing <testfile> argument\n"); g_print ("1..0\nnot ok # Missing <testfile> argument\n");
@ -210,9 +211,10 @@ main (int argc, gchar ** argv)
/* Running the subprocess in it own thread so that we can properly catch /* Running the subprocess in it own thread so that we can properly catch
* interuptions in the main thread main loop */ * 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_run (app.ml);
g_main_loop_unref (app.ml); g_main_loop_unref (app.ml);
g_thread_join (thread);
g_strfreev (args); g_strfreev (args);
return app.exitcode; return app.exitcode;