Fix shutdown crash

Fixed crash due to destructor of CSocketCreator being called during shutdown. If the socket fails to close, an error is logged. But at this point, all sockets have been closed already and the logger system has already been destroyed. Allocated as dynamic memory to avoid destructor being called at this stage.
This commit is contained in:
Kawe Mazidjatari 2023-04-23 18:01:30 +02:00
parent 1eef4aacb4
commit 615de70b1f
2 changed files with 4 additions and 4 deletions

View File

@ -200,8 +200,8 @@ bool CRConClient::IsConnected(void)
}
///////////////////////////////////////////////////////////////////////////////
CRConClient g_RCONClient;
CRConClient* g_RCONClient(new CRConClient());
CRConClient* RCONClient() // Singleton RCON Client.
{
return &g_RCONClient;
return g_RCONClient;
}

View File

@ -614,8 +614,8 @@ int CRConServer::GetAuthenticatedCount(void) const
}
///////////////////////////////////////////////////////////////////////////////
CRConServer g_RCONServer;
CRConServer* g_RCONServer(new CRConServer());
CRConServer* RCONServer() // Singleton RCON Server.
{
return &g_RCONServer;
return g_RCONServer;
}