server: fix dangling thread if glib main loop fails

This commit is contained in:
Koushik Dutta
2023-03-14 09:18:00 -07:00
parent 457fc96332
commit 8e34bc2130

View File

@@ -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)