From 8760c9a54744e75b706af92698d6e90d7e56dc5b Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Sun, 30 Jun 2013 15:57:33 -0700 Subject: [PATCH] Use unique_ptr in Connection rather than a shared_ptr --- aegisub/libaegisub/include/libaegisub/signal.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/aegisub/libaegisub/include/libaegisub/signal.h b/aegisub/libaegisub/include/libaegisub/signal.h index 4f897b35a..0c8aa186f 100644 --- a/aegisub/libaegisub/include/libaegisub/signal.h +++ b/aegisub/libaegisub/include/libaegisub/signal.h @@ -52,10 +52,12 @@ namespace detail { /// @class Connection /// @brief Object representing a connection to a signal class Connection { - std::shared_ptr token; + std::unique_ptr token; public: Connection() { } + Connection(Connection&& that) : token(std::move(that.token)) { } Connection(detail::ConnectionToken *token) : token(token) { token->claimed = true; } + Connection& operator=(Connection&& that) { token = std::move(that.token); return *this; } /// @brief End this connection ///