mirror of https://github.com/odrling/Aegisub
Use unique_ptr in Connection rather than a shared_ptr
This commit is contained in:
parent
098ffd0a92
commit
8760c9a547
|
@ -52,10 +52,12 @@ namespace detail {
|
||||||
/// @class Connection
|
/// @class Connection
|
||||||
/// @brief Object representing a connection to a signal
|
/// @brief Object representing a connection to a signal
|
||||||
class Connection {
|
class Connection {
|
||||||
std::shared_ptr<detail::ConnectionToken> token;
|
std::unique_ptr<detail::ConnectionToken> token;
|
||||||
public:
|
public:
|
||||||
Connection() { }
|
Connection() { }
|
||||||
|
Connection(Connection&& that) : token(std::move(that.token)) { }
|
||||||
Connection(detail::ConnectionToken *token) : token(token) { token->claimed = true; }
|
Connection(detail::ConnectionToken *token) : token(token) { token->claimed = true; }
|
||||||
|
Connection& operator=(Connection&& that) { token = std::move(that.token); return *this; }
|
||||||
|
|
||||||
/// @brief End this connection
|
/// @brief End this connection
|
||||||
///
|
///
|
||||||
|
|
Loading…
Reference in New Issue