summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2025-03-16 13:52:14 +0800
committerlittleblack111 <littleblack11111@gmail.com>2025-03-20 23:45:01 +0800
commit36a1cfd61b8915e2a532ea5aa615bed9c2c0d24e (patch)
treec1273f5810116a9211190683332b0a1e59230246 /src
parent7a9b3381eb78163dbc1d5b2e89b5a0daae883ed4 (diff)
chatServer: atexit() -> cleanup()
Diffstat (limited to 'src')
-rw-r--r--src/chatServer.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/chatServer.cpp b/src/chatServer.cpp
index 11d4919..8e9a3ab 100644
--- a/src/chatServer.cpp
+++ b/src/chatServer.cpp
@@ -6,6 +6,9 @@
CChatServer::CChatServer(uint16_t port)
: m_port(port) {
+ if (std::atexit([]() { g_pChatServer->cleanup(); }))
+ log(ERR, "Failed to register CChatServer atexit handler, dtors will not be called");
+
log(LOG, "ChatServer: initialized");
};