aboutsummaryrefslogtreecommitdiff
path: root/src/GlobalHotkeysLinux.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/GlobalHotkeysLinux.cpp')
-rw-r--r--src/GlobalHotkeysLinux.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/GlobalHotkeysLinux.cpp b/src/GlobalHotkeysLinux.cpp
index 08803d7..b0e8e52 100644
--- a/src/GlobalHotkeysLinux.cpp
+++ b/src/GlobalHotkeysLinux.cpp
@@ -15,12 +15,6 @@ 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]);
@@ -28,6 +22,12 @@ 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() {