Instance: wrap ClientList in std::unique_ptr<>
This commit is contained in:
parent
71a5c8b819
commit
39046bed85
@ -22,6 +22,7 @@
|
||||
#include "Partition.hxx"
|
||||
#include "Idle.hxx"
|
||||
#include "Stats.hxx"
|
||||
#include "client/List.hxx"
|
||||
|
||||
#ifdef ENABLE_CURL
|
||||
#include "RemoteTagCache.hxx"
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user