From fa0d77f267a9833ebb22d1b3ffabf9c5c5b128c4 Mon Sep 17 00:00:00 2001 From: Michael Carlberg Date: Fri, 23 Dec 2016 01:07:00 +0100 Subject: [PATCH] refactor(file_descriptor): Use unique_ptr --- include/components/controller.hpp | 4 ++-- include/components/ipc.hpp | 2 +- include/utils/file.hpp | 2 +- include/x11/connection.hpp | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/components/controller.hpp b/include/components/controller.hpp index d8617ea8..30958d9b 100644 --- a/include/components/controller.hpp +++ b/include/components/controller.hpp @@ -80,8 +80,8 @@ class controller : public signal_receiver m_confwatch; unique_ptr m_command; - shared_ptr m_fdevent_rd; - shared_ptr m_fdevent_wr; + unique_ptr m_fdevent_rd; + unique_ptr m_fdevent_wr; /** * @brief Controls weather the output gets printed to stdout diff --git a/include/components/ipc.hpp b/include/components/ipc.hpp index 8180fb09..39ac30b8 100644 --- a/include/components/ipc.hpp +++ b/include/components/ipc.hpp @@ -48,7 +48,7 @@ class ipc { const logger& m_log; string m_path{}; - shared_ptr m_fd{}; + unique_ptr m_fd{}; }; POLYBAR_NS_END diff --git a/include/utils/file.hpp b/include/utils/file.hpp index b0531f99..6bd695ac 100644 --- a/include/utils/file.hpp +++ b/include/utils/file.hpp @@ -43,7 +43,7 @@ namespace file_util { template decltype(auto) make_file_descriptor(Args&&... args) { - return factory_util::shared(forward(args)...); + return factory_util::unique(forward(args)...); } } diff --git a/include/x11/connection.hpp b/include/x11/connection.hpp index 92305ac2..f9a9a54c 100644 --- a/include/x11/connection.hpp +++ b/include/x11/connection.hpp @@ -89,7 +89,7 @@ class connection : public xpp_connection { protected: registry m_registry{*this}; xcb_screen_t* m_screen{nullptr}; - shared_ptr m_connection_fd; + unique_ptr m_connection_fd; }; POLYBAR_NS_END