summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 97aa8b3)
raw | patch | inline | side by side (parent: 97aa8b3)
author | Max Kellermann <max@duempel.org> | |
Thu, 18 Sep 2008 07:44:01 +0000 (09:44 +0200) | ||
committer | Max Kellermann <max@duempel.org> | |
Thu, 18 Sep 2008 07:44:01 +0000 (09:44 +0200) |
Call g_main_loop_quit() on CMD_QUIT, instead of exit() with an
atexit() handler.
atexit() handler.
src/main.c | patch | blob | history | |
src/screen.c | patch | blob | history |
diff --git a/src/main.c b/src/main.c
index f29ce67fdbae5561db17ac8e4590fe2fc14f3586..c8b22df5fd6754422b14d999ccaccc537178ad08 100644 (file)
--- a/src/main.c
+++ b/src/main.c
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) {
exit(EXIT_FAILURE);
}
- /* install exit function */
- atexit(exit_and_cleanup);
-
ncurses_init();
lyrics_init();
diff --git a/src/screen.c b/src/screen.c
index 479b1de5d351c364a8333dbee5eab803de715474..e0fa3e1c73b03ea96b5fd22e006fcf5880c45c90 100644 (file)
--- a/src/screen.c
+++ b/src/screen.c
case CMD_SCREEN_LYRICS:
switch_screen_mode(SCREEN_LYRICS_ID, c);
break;
- case CMD_QUIT:
- exit(EXIT_SUCCESS);
default:
break;
}