Store concrete manager
manager_t is movable, concrete RAII object; Inside object_manager,
there is no reason it needs to be stored by unique_ptr. Move to storing
the manager by value instead of by pointer.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I97206fd3a4cfea43ab6836f45b92a1bb2adb5c32
diff --git a/include/sdbusplus/asio/object_server.hpp b/include/sdbusplus/asio/object_server.hpp
index 975674a..c8f8de2 100644
--- a/include/sdbusplus/asio/object_server.hpp
+++ b/include/sdbusplus/asio/object_server.hpp
@@ -839,9 +839,8 @@
void add_manager(const std::string& path)
{
- managers_.emplace_back(
- std::make_unique<server::manager_t>(server::manager_t(
- static_cast<sdbusplus::bus_t&>(*conn_), path.c_str())));
+ managers_.emplace_back(static_cast<sdbusplus::bus_t&>(*conn_),
+ path.c_str());
}
bool remove_interface(const std::shared_ptr<dbus_interface>& iface)
@@ -859,7 +858,7 @@
private:
std::shared_ptr<sdbusplus::asio::connection> conn_;
std::vector<std::shared_ptr<dbus_interface>> interfaces_;
- std::vector<std::unique_ptr<server::manager_t>> managers_;
+ std::vector<server::manager_t> managers_;
};
} // namespace asio