From 8e34bc2130f19fbd7452e0571aca0ff2fcd30f6c Mon Sep 17 00:00:00 2001 From: Koushik Dutta Date: Tue, 14 Mar 2023 09:18:00 -0700 Subject: [PATCH] server: fix dangling thread if glib main loop fails --- server/python/plugin_remote.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/python/plugin_remote.py b/server/python/plugin_remote.py index 9995d7056..43de3dd0e 100644 --- a/server/python/plugin_remote.py +++ b/server/python/plugin_remote.py @@ -601,10 +601,11 @@ def plugin_main(readFd: int, writeFd: int): from gi.repository import GLib, Gst Gst.init(None) - worker = threading.Thread(target=main, args=(readFd, writeFd)) + loop = GLib.MainLoop() + + worker = threading.Thread(target=main, args=(readFd, writeFd), name="asyncio-main") worker.start() - loop = GLib.MainLoop() loop.run() except: main(readFd, writeFd)