diff options
author | Max Kellermann <max@duempel.org> | 2009-01-10 18:55:43 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-01-10 18:55:43 +0100 |
commit | 63d9827c34d293540005a40346fb0149b66f3816 (patch) | |
tree | d45b9838b02ec066ed5de2dd87bca2ded9b46915 /src | |
parent | 0366adddbd0c09e0977f9fa574918868d6921744 (diff) | |
download | mpd-63d9827c34d293540005a40346fb0149b66f3816.tar.gz mpd-63d9827c34d293540005a40346fb0149b66f3816.tar.xz mpd-63d9827c34d293540005a40346fb0149b66f3816.zip |
main: remove "save_state" timer event on exit
Diffstat (limited to '')
-rw-r--r-- | src/main.c | 5 |
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(); |