Fix segfault on close with --no-video
Do not call sc_screen_hide_window() if screen is not initialized. To reproduce: scrcpy --no-video --record=file.mp4 This only segfaults in debug mode since commit fd0f432e877153d83ed435474fb7b04e41de4269.
This commit is contained in:
parent
bf625790fa
commit
aa34d63171
@ -805,9 +805,12 @@ scrcpy(struct scrcpy_options *options) {
|
||||
ret = event_loop(s);
|
||||
LOGD("quit...");
|
||||
|
||||
// Close the window immediately on closing, because screen_destroy() may
|
||||
// only be called once the video demuxer thread is joined (it may take time)
|
||||
sc_screen_hide_window(&s->screen);
|
||||
if (options->video_playback) {
|
||||
// Close the window immediately on closing, because screen_destroy()
|
||||
// may only be called once the video demuxer thread is joined (it may
|
||||
// take time)
|
||||
sc_screen_hide_window(&s->screen);
|
||||
}
|
||||
|
||||
end:
|
||||
if (timeout_started) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user