diff --git a/src/cache.c b/src/cache.c index efdc3aec..be77ab7f 100644 --- a/src/cache.c +++ b/src/cache.c @@ -1723,10 +1723,10 @@ cache_deinit(void) } // Free event base (should free events too) - commands_base_free(cmdbase); event_base_free(evbase_cache); - // Close pipes + // Close pipes and free command base + commands_base_free(cmdbase); close(g_exit_pipe[0]); close(g_exit_pipe[1]); } diff --git a/src/filescanner.c b/src/filescanner.c index 8517d563..2b19ea1f 100644 --- a/src/filescanner.c +++ b/src/filescanner.c @@ -2085,8 +2085,8 @@ filescanner_deinit(void) inofd_event_unset(); + event_base_free(evbase_scan); + commands_base_free(cmdbase); close(exit_pipe[0]); close(exit_pipe[1]); - commands_base_free(cmdbase); - event_base_free(evbase_scan); } diff --git a/src/mpd.c b/src/mpd.c index 191d6143..846280c2 100644 --- a/src/mpd.c +++ b/src/mpd.c @@ -4853,8 +4853,6 @@ void mpd_deinit(void) free(temp); } - commands_base_free(cmdbase); - http_port = cfg_getint(cfg_getsec(cfg, "mpd"), "http_port"); if (http_port > 0) evhttp_free(evhttpd); @@ -4864,7 +4862,8 @@ void mpd_deinit(void) // Free event base (should free events too) event_base_free(evbase_mpd); - // Close pipes + // Close pipes and free command base + commands_base_free(cmdbase); close(g_exit_pipe[0]); close(g_exit_pipe[1]); } diff --git a/src/player.c b/src/player.c index 6d7475ab..5b39576c 100644 --- a/src/player.c +++ b/src/player.c @@ -4183,12 +4183,13 @@ player_deinit(void) timer_delete(pb_timer); #endif - commands_base_free(cmdbase); evbuffer_free(audio_buf); outputs_deinit(); + event_base_free(evbase_player); + + commands_base_free(cmdbase); close(exit_pipe[0]); close(exit_pipe[1]); - event_base_free(evbase_player); } diff --git a/src/spotify.c b/src/spotify.c index 34ef3a55..8bd3c3f9 100644 --- a/src/spotify.c +++ b/src/spotify.c @@ -2154,9 +2154,9 @@ spotify_deinit(void) /* Free event base (should free events too) */ event_base_free(evbase_spotify); - commands_base_free(cmdbase); - /* Close pipes */ + /* Close pipes and free command base */ + commands_base_free(cmdbase); close(g_notify_pipe[0]); close(g_notify_pipe[1]); close(g_exit_pipe[0]); diff --git a/src/worker.c b/src/worker.c index dbd4a61b..6bb90d73 100644 --- a/src/worker.c +++ b/src/worker.c @@ -279,10 +279,10 @@ worker_deinit(void) } // Free event base (should free events too) - commands_base_free(cmdbase); event_base_free(evbase_worker); - // Close pipes + // Close pipes and free command base + commands_base_free(cmdbase); close(g_exit_pipe[0]); close(g_exit_pipe[1]); }