Instance: wrap ClientList in std::unique_ptr<>

This commit is contained in:
Max Kellermann 2019-05-29 21:29:55 +02:00
parent 71a5c8b819
commit 39046bed85
3 changed files with 3 additions and 4 deletions

View File

@ -22,6 +22,7 @@
#include "Partition.hxx"
#include "Idle.hxx"
#include "Stats.hxx"
#include "client/List.hxx"
#ifdef ENABLE_CURL
#include "RemoteTagCache.hxx"

View File

@ -120,7 +120,7 @@ struct Instance final
std::unique_ptr<RemoteTagCache> remote_tag_cache;
#endif
ClientList *client_list;
std::unique_ptr<ClientList> client_list;
std::list<Partition> partitions;

View File

@ -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<ClientList>(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