diff --git a/src/engine/server/server.cpp b/src/engine/server/server.cpp index 4e916c9a2..1a24a0573 100644 --- a/src/engine/server/server.cpp +++ b/src/engine/server/server.cpp @@ -329,6 +329,17 @@ CServer::CServer() : Init(); } +CServer::~CServer() +{ + for(auto &pCurrentMapData : m_apCurrentMapData) + { + if(pCurrentMapData) + free(pCurrentMapData); + } + + delete m_pConnectionPool; +} + bool CServer::IsClientNameAvailable(int ClientID, const char *pNameRequest) { // check for empty names @@ -2649,11 +2660,7 @@ int CServer::Run() GameServer()->OnShutdown(); m_pMap->Unload(); - for(auto &pCurrentMapData : m_apCurrentMapData) - free(pCurrentMapData); - DbPool()->OnShutdown(); - delete m_pConnectionPool; #if defined(CONF_UPNP) m_UPnP.Shutdown(); diff --git a/src/engine/server/server.h b/src/engine/server/server.h index 56913e109..1a4ccf116 100644 --- a/src/engine/server/server.h +++ b/src/engine/server/server.h @@ -257,6 +257,7 @@ public: array m_aNameBans; CServer(); + ~CServer(); bool IsClientNameAvailable(int ClientID, const char *pNameRequest); bool SetClientNameImpl(int ClientID, const char *pNameRequest, bool Set);