aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/main.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index 28eb4f4c7..03e81366c 100644
--- a/src/main.c
+++ b/src/main.c
@@ -218,6 +218,7 @@ int main(int argc, char *argv[])
Options options;
clock_t start;
GTimer *save_state_timer;
+ guint save_state_source_id;
daemonize_close_stdin();
@@ -295,7 +296,8 @@ int main(int argc, char *argv[])
save_state_timer = g_timer_new();
- g_timeout_add(5 * 60 * 1000, timer_save_state_file, NULL);
+ save_state_source_id = g_timeout_add(5 * 60 * 1000,
+ timer_save_state_file, NULL);
/* run the main loop */
@@ -305,6 +307,7 @@ int main(int argc, char *argv[])
g_main_loop_unref(main_loop);
+ g_source_remove(save_state_source_id);
g_timer_destroy(save_state_timer);
write_state_file();