summaryrefslogtreecommitdiff
path: root/src/sessionManager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/sessionManager.cpp')
-rw-r--r--src/sessionManager.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/sessionManager.cpp b/src/sessionManager.cpp
index f4573e1..b4e1ad5 100644
--- a/src/sessionManager.cpp
+++ b/src/sessionManager.cpp
@@ -6,7 +6,15 @@
#include <utility>
#include "log.hpp"
+void CSessionManager::shutdownSessions() {
+ for (const auto &[thread, session] : m_vSessions)
+ session->onShutdown();
+}
+
CSessionManager::CSessionManager() {
+ if (std::atexit([]() { g_pSessionManager->shutdownSessions(); }))
+ log(ERR, "Failed to register SessionManager atexit handler, will fallback to quick_exit after hang");
+
log(LOG, "SessionManager: initialized");
};