diff --git a/src/Instance.cxx b/src/Instance.cxx index f9aca0038..090ae2295 100644 --- a/src/Instance.cxx +++ b/src/Instance.cxx @@ -22,6 +22,7 @@ #include "Partition.hxx" #include "Idle.hxx" #include "Stats.hxx" +#include "client/List.hxx" #ifdef ENABLE_CURL #include "RemoteTagCache.hxx" diff --git a/src/Instance.hxx b/src/Instance.hxx index 5626ceb33..754524bef 100644 --- a/src/Instance.hxx +++ b/src/Instance.hxx @@ -120,7 +120,7 @@ struct Instance final std::unique_ptr remote_tag_cache; #endif - ClientList *client_list; + std::unique_ptr client_list; std::list partitions; diff --git a/src/Main.cxx b/src/Main.cxx index cf212fb45..7e3b1fcf4 100644 --- a/src/Main.cxx +++ b/src/Main.cxx @@ -441,7 +441,7 @@ MainConfigured(const struct options &options, const ConfigData &raw_config) const unsigned max_clients = raw_config.GetPositive(ConfigOption::MAX_CONN, 10); - instance.client_list = new ClientList(max_clients); + instance.client_list = std::make_unique(max_clients); initialize_decoder_and_player(instance, raw_config, config.replay_gain); @@ -617,8 +617,6 @@ mpd_main_after_fork(Instance &instance, ZeroconfDeinit(); instance.BeginShutdownPartitions(); - - delete instance.client_list; } #ifdef ANDROID