diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2025-04-07 18:20:47 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2025-04-07 18:21:45 +0800 |
| commit | a38b8c35e4c9b85e0b035c5dfa2bee26a5c36b65 (patch) | |
| tree | 841c5bdf7d9466ed94316c64336efcd709e6ec18 /src/session.cpp | |
| parent | cfb29cfd831b8c44112dd15c821ce235e78beb2e (diff) | |
internal: use smart pointer for everything, no more naked pointer
Diffstat (limited to 'src/session.cpp')
| -rw-r--r-- | src/session.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/session.cpp b/src/session.cpp index c71432d..661086b 100644 --- a/src/session.cpp +++ b/src/session.cpp @@ -152,7 +152,7 @@ void CSession::run() { } else log(LOG, "Client {} exited without even registering", m_ip); - g_pSessionManager->kick(self); + g_pSessionManager->kick(std::move(self)); } bool CSession::isMuted() const { @@ -267,6 +267,6 @@ const std::string &CSession::getIp() const { return m_ip; } -void CSession::setSelf(std::pair<std::jthread, std::shared_ptr<CSession>> *self) { - this->self = self; +void CSession::setSelf(std::unique_ptr<std::pair<std::jthread, std::shared_ptr<CSession>>> self) { + this->self = std::move(self); } |
