summaryrefslogtreecommitdiff
path: root/src/sessionManager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/sessionManager.cpp')
-rw-r--r--src/sessionManager.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/sessionManager.cpp b/src/sessionManager.cpp
index d880640..49d65b1 100644
--- a/src/sessionManager.cpp
+++ b/src/sessionManager.cpp
@@ -8,12 +8,17 @@
#include <utility>
void CSessionManager::shutdownSessions() {
+ if (m_vSessions.empty())
+ return;
+
for (auto &session : m_vSessions)
kick(&session, false, "Server shutting down");
}
CSessionManager::CSessionManager() {
- if (std::atexit([]() { g_pSessionManager->shutdownSessions(); }))
+ if (std::atexit([]() {
+ if (g_pSessionManager) g_pSessionManager->shutdownSessions();
+ }))
log(ERR, "Failed to register SessionManager atexit handler, will fallback to quick_exit after hang");
log(LOG, "SessionManager: initialized");