From d0e090e1f92f943c082c03fcb156db9052c0cc01 Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Sat, 10 Nov 2018 14:01:57 +0100 Subject: [PATCH] Reenable custom SDL signal handlers This partially reverts commit f00c6c5b1321860eb6d590928448778ec8f43278. On Ctrl+C, we need to execute cleanup code. For instance, if recording is enabled, we need to write MP4 file trailer on exit. Custom SDL signal handlers were disabled because it leaded to process hanging on Ctrl+C during network calls on initialization, but now it seems to work correctly, the network calls return immediately on signal. --- app/src/scrcpy.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/app/src/scrcpy.c b/app/src/scrcpy.c index 1f10b676..766c26f2 100644 --- a/app/src/scrcpy.c +++ b/app/src/scrcpy.c @@ -155,10 +155,6 @@ SDL_bool scrcpy(const struct scrcpy_options *options) { SDL_bool ret = SDL_TRUE; - if (!SDL_SetHint(SDL_HINT_NO_SIGNAL_HANDLERS, "1")) { - LOGW("Cannot request to keep default signal handlers"); - } - if (!sdl_init_and_configure()) { ret = SDL_FALSE; goto finally_destroy_server;