# HG changeset patch # User David Demelier # Date 1509043519 -7200 # Node ID bb65cec664c53c360dbc05ffec151dc837f87762 # Parent 9c18bfff72ef378903dce763cd09b1f6db19d395 Irccd: use unique_ptr for services diff -r 9c18bfff72ef -r bb65cec664c5 libirccd/irccd/irccd.cpp --- a/libirccd/irccd/irccd.cpp Thu Oct 26 12:50:54 2017 +0200 +++ b/libirccd/irccd/irccd.cpp Thu Oct 26 20:45:19 2017 +0200 @@ -25,15 +25,17 @@ namespace irccd { irccd::irccd() - : command_service_(std::make_shared()) - , itr_service_(std::make_shared()) - , server_service_(std::make_shared(*this)) - , tpt_service_(std::make_shared(*this)) - , rule_service_(std::make_shared()) - , plugin_service_(std::make_shared(*this)) + : command_service_(std::make_unique()) + , itr_service_(std::make_unique()) + , server_service_(std::make_unique(*this)) + , tpt_service_(std::make_unique(*this)) + , rule_service_(std::make_unique()) + , plugin_service_(std::make_unique(*this)) { } +irccd::~irccd() = default; + void irccd::post(std::function ev) noexcept { std::lock_guard lock(mutex_); diff -r 9c18bfff72ef -r bb65cec664c5 libirccd/irccd/irccd.hpp --- a/libirccd/irccd/irccd.hpp Thu Oct 26 12:50:54 2017 +0200 +++ b/libirccd/irccd/irccd.hpp Thu Oct 26 20:45:19 2017 +0200 @@ -77,6 +77,11 @@ irccd(); /** + * Default destructor. + */ + ~irccd(); + + /** * Access the command service. * * \return the service