Fixing handle leak. Actually, this should be backported to the current server...

This commit is contained in:
lotodore
2009-09-26 21:53:18 +00:00
parent 0ab836e09f
commit 9e6ca8cd66
+5 -2
View File
@@ -1533,7 +1533,7 @@ void
ServerLobbyThread::InternalCheckSessionTimeouts(SessionWrapper session)
{
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)
{
@@ -1565,7 +1565,10 @@ ServerLobbyThread::InternalCheckSessionTimeouts(SessionWrapper session)
}
if (closeSession)
{
RemovePlayer(session.playerData->GetUniqueId(), ERR_NET_SESSION_TIMED_OUT);
if (session.playerData.get())
RemovePlayer(session.playerData->GetUniqueId(), ERR_NET_SESSION_TIMED_OUT);
else
m_sessionManager.RemoveSession(session.sessionData->GetId());
}
}