diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2025-03-12 14:49:35 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2025-03-20 23:44:59 +0800 |
| commit | 73c9cb4dfaa1da463534862813c3ea3a528a4b03 (patch) | |
| tree | b5c1271b226c618d9dc983569c4d7cfbf795d09c /src/sessionManager.cpp | |
| parent | f3f18166564d6f33abdba19cbcc03f826c44161a (diff) | |
cleanup: shared ptr .get() and std::move() use cases
fixes a bug where dtor of CSession is not called
Diffstat (limited to 'src/sessionManager.cpp')
| -rw-r--r-- | src/sessionManager.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/sessionManager.cpp b/src/sessionManager.cpp index d77c0ae..f5b29af 100644 --- a/src/sessionManager.cpp +++ b/src/sessionManager.cpp @@ -27,7 +27,7 @@ CSessionManager::~CSessionManager() { std::pair<std::jthread, std::shared_ptr<CSession>> *CSessionManager::newSession() { std::shared_ptr session = std::make_shared<CSession>(); - const auto instance = &m_vSessions.emplace_back(std::jthread(&CSession::run, session), std::move(session)); + const auto instance = &m_vSessions.emplace_back(std::jthread(&CSession::run, session.get()), session); instance->second->setSelf(instance); return instance; } |
