Fixing handle leak. Actually, this should be backported to the current server...
This commit is contained in:
@@ -1533,7 +1533,7 @@ void
|
|||||||
ServerLobbyThread::InternalCheckSessionTimeouts(SessionWrapper session)
|
ServerLobbyThread::InternalCheckSessionTimeouts(SessionWrapper session)
|
||||||
{
|
{
|
||||||
bool closeSession = false;
|
bool closeSession = false;
|
||||||
if (session.sessionData.get() && session.playerData.get())
|
if (session.sessionData.get())
|
||||||
{
|
{
|
||||||
if (session.sessionData->GetState() == SessionData::Init && session.sessionData->GetAutoDisconnectTimerElapsedSec() >= SERVER_INIT_SESSION_TIMEOUT_SEC)
|
if (session.sessionData->GetState() == SessionData::Init && session.sessionData->GetAutoDisconnectTimerElapsedSec() >= SERVER_INIT_SESSION_TIMEOUT_SEC)
|
||||||
{
|
{
|
||||||
@@ -1565,7 +1565,10 @@ ServerLobbyThread::InternalCheckSessionTimeouts(SessionWrapper session)
|
|||||||
}
|
}
|
||||||
if (closeSession)
|
if (closeSession)
|
||||||
{
|
{
|
||||||
|
if (session.playerData.get())
|
||||||
RemovePlayer(session.playerData->GetUniqueId(), ERR_NET_SESSION_TIMED_OUT);
|
RemovePlayer(session.playerData->GetUniqueId(), ERR_NET_SESSION_TIMED_OUT);
|
||||||
|
else
|
||||||
|
m_sessionManager.RemoveSession(session.sessionData->GetId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user