gnomecast icon indicating copy to clipboard operation
gnomecast copied to clipboard

Fix unable to close / exit the application until the application "init" phase finishes

Open Kami opened this issue 5 years ago • 0 comments

Problem Description

Right now when you start the app, two non-daemon / "blocking" threads are started - check ffmpeg and "init casts".

Those two threads "block" the main GUI loop which means if you press CTRL+C / "x" button, application won't exit until those two threads finish.

Init casts thread discovers Chromecasts on the local network which means it can take quite a while to finish and as mentioned above, you can't "gracefully" exit / close the application until it finishes.

Proposed Solution

This pull request fixes that by making those two threads daemon threads.

This means CTRL + C / "x" button will work as expected and the application will exit immediately.

There are also other possible approaches, but this one is the simplest and less invasive with the correct end result.

Kami avatar Jan 24 '20 18:01 Kami