aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-09-18 09:44:01 +0200
committerMax Kellermann <max@duempel.org>2008-09-18 09:44:01 +0200
commit919cebb0bcd44170a7dd773717eefa1e515d628c (patch)
tree379f32627c1a8859022822020c1bd2dc48672ab3 /src/main.c
parent97aa8b3d2af61beab67ca4882251ce68582b95b6 (diff)
downloadmpd-919cebb0bcd44170a7dd773717eefa1e515d628c.tar.gz
mpd-919cebb0bcd44170a7dd773717eefa1e515d628c.tar.xz
mpd-919cebb0bcd44170a7dd773717eefa1e515d628c.zip
quit with g_main_loop_quit()
Call g_main_loop_quit() on CMD_QUIT, instead of exit() with an atexit() handler.
Diffstat (limited to '')
-rw-r--r--src/main.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/main.c b/src/main.c
index f29ce67fd..c8b22df5f 100644
--- a/src/main.c
+++ b/src/main.c
@@ -263,6 +263,11 @@ keyboard_event(mpd_unused GIOChannel *source,
g_source_remove(idle_source_id);
if ((cmd=get_keyboard_command()) != CMD_NONE) {
+ if (cmd == CMD_QUIT) {
+ g_main_loop_quit(main_loop);
+ return FALSE;
+ }
+
screen_cmd(mpd, cmd);
if (cmd == CMD_VOLUME_UP || cmd == CMD_VOLUME_DOWN) {
@@ -378,9 +383,6 @@ main(int argc, const char *argv[])
exit(EXIT_FAILURE);
}
- /* install exit function */
- atexit(exit_and_cleanup);
-
ncurses_init();
lyrics_init();