Hide the window immediately on close
The screen may not be destroyed immediately on close to avoid undefined behavior, because it may still receive events from the decoder. But the visual window must still be closed immediately.
This commit is contained in:
@@ -398,6 +398,10 @@ scrcpy(const struct scrcpy_options *options) {
|
||||
ret = event_loop(options);
|
||||
LOGD("quit...");
|
||||
|
||||
// Close the window immediately on closing, because screen_destroy() may
|
||||
// only be called once the stream thread is joined (it may take time)
|
||||
screen_hide_window(&screen);
|
||||
|
||||
end:
|
||||
// The stream is not stopped explicitly, because it will stop by itself on
|
||||
// end-of-stream
|
||||
|
||||
Reference in New Issue
Block a user