Fix missing installer initialization

The current_process field of struct installer was not initialized.
Since the installer instance is static, its default value was 0.

The call to installer_stop() then called kill(0, SIGTERM) (on Linux),
which sent SIGTERM to every process in the process group. In particular,
the scrcpy process was killed.

As a consequence, the last cleanup steps, like disabling "show touches",
were not executed.

Fixes <https://github.com/Genymobile/scrcpy/issues/183>.
This commit is contained in:
Romain Vimont 2018-06-22 18:30:36 +02:00
parent 8890750681
commit 1a0139321b

View file

@ -79,6 +79,8 @@ SDL_bool installer_init(struct installer *installer, const char *serial) {
installer->initialized = SDL_FALSE;
installer->stopped = SDL_FALSE;
installer->current_process = PROCESS_NONE;
return SDL_TRUE;
}