Fix getting stuck on shutdown with SIGINT

This commit is contained in:
dec05eba
2024-11-24 19:39:23 +01:00
parent 3468554eb3
commit a008d83514

View File

@@ -15,6 +15,12 @@ namespace gsr {
}
GlobalHotkeysLinux::~GlobalHotkeysLinux() {
if(process_id > 0) {
kill(process_id, SIGKILL);
int status;
waitpid(process_id, &status, 0);
}
for(int i = 0; i < 2; ++i) {
if(pipes[i] > 0)
close(pipes[i]);
@@ -22,12 +28,6 @@ namespace gsr {
if(read_file)
fclose(read_file);
if(process_id > 0) {
kill(process_id, SIGKILL);
int status;
waitpid(process_id, &status, 0);
}
}
bool GlobalHotkeysLinux::start() {
@@ -105,4 +105,4 @@ namespace gsr {
if(it != bound_actions_by_id.end())
it->second(action);
}
}
}