Code

main: merge exit_and_cleanup() into main()
authorMax Kellermann <max.kellermann@gmail.com>
Sun, 19 Mar 2017 09:42:00 +0000 (10:42 +0100)
committerMax Kellermann <max.kellermann@gmail.com>
Sun, 19 Mar 2017 09:42:00 +0000 (10:42 +0100)
There's no point in having this function that is called only once.

src/main.c

index 12bee3d733a2e9733ab27f8a8feb37c4079500e5..af6732737d2fd26079057501819b930b4b2a6095 100644 (file)
@@ -90,18 +90,6 @@ update_xterm_title(void)
 }
 #endif
 
-static void
-exit_and_cleanup(void)
-{
-       screen_exit();
-#ifndef NCMPC_MINI
-       set_xterm_title("");
-#endif
-       printf("\n");
-
-       mpdclient_free(mpd);
-}
-
 #ifndef WIN32
 static void
 catch_sigint(gcc_unused int sig)
@@ -626,7 +614,13 @@ main(int argc, const char *argv[])
        ncmpc_lirc_close();
 #endif
 
-       exit_and_cleanup();
+       screen_exit();
+#ifndef NCMPC_MINI
+       set_xterm_title("");
+#endif
+       printf("\n");
+
+       mpdclient_free(mpd);
 
 #ifdef ENABLE_LYRICS_SCREEN
        lyrics_deinit();