refactor(file_descriptor): Use unique_ptr

This commit is contained in:
Michael Carlberg 2016-12-23 01:07:00 +01:00
parent d4e3891ab6
commit fa0d77f267
4 changed files with 5 additions and 5 deletions

View File

@ -80,8 +80,8 @@ class controller : public signal_receiver<SIGN_PRIORITY_CONTROLLER, sig_ev::proc
unique_ptr<inotify_watch> m_confwatch; unique_ptr<inotify_watch> m_confwatch;
unique_ptr<command> m_command; unique_ptr<command> m_command;
shared_ptr<file_descriptor> m_fdevent_rd; unique_ptr<file_descriptor> m_fdevent_rd;
shared_ptr<file_descriptor> m_fdevent_wr; unique_ptr<file_descriptor> m_fdevent_wr;
/** /**
* @brief Controls weather the output gets printed to stdout * @brief Controls weather the output gets printed to stdout

View File

@ -48,7 +48,7 @@ class ipc {
const logger& m_log; const logger& m_log;
string m_path{}; string m_path{};
shared_ptr<file_descriptor> m_fd{}; unique_ptr<file_descriptor> m_fd{};
}; };
POLYBAR_NS_END POLYBAR_NS_END

View File

@ -43,7 +43,7 @@ namespace file_util {
template <typename... Args> template <typename... Args>
decltype(auto) make_file_descriptor(Args&&... args) { decltype(auto) make_file_descriptor(Args&&... args) {
return factory_util::shared<file_descriptor>(forward<Args>(args)...); return factory_util::unique<file_descriptor>(forward<Args>(args)...);
} }
} }

View File

@ -89,7 +89,7 @@ class connection : public xpp_connection {
protected: protected:
registry m_registry{*this}; registry m_registry{*this};
xcb_screen_t* m_screen{nullptr}; xcb_screen_t* m_screen{nullptr};
shared_ptr<file_descriptor> m_connection_fd; unique_ptr<file_descriptor> m_connection_fd;
}; };
POLYBAR_NS_END POLYBAR_NS_END