Make sure that socket reference is removed on closing WorldSession server sided before ReactorRunnable does in the reactor event loop.

--HG--
branch : trunk
This commit is contained in:
Machiavelli
2010-05-05 22:56:02 +02:00
parent d6f7547eba
commit 6ad4d4c8d2

View File

@@ -275,10 +275,14 @@ bool WorldSession::Update(uint32 /*diff*/)
delete packet;
}
///- If necessary, kick the player from the character select screen
if (IsConnectionIdle())
m_Socket->CloseSocket();
///- Cleanup socket pointer if need
if (m_Socket && m_Socket->IsClosed ())
if (m_Socket && m_Socket->IsClosed())
{
m_Socket->RemoveReference ();
m_Socket->RemoveReference();
m_Socket = NULL;
}
@@ -287,10 +291,6 @@ bool WorldSession::Update(uint32 /*diff*/)
if (!m_Socket || (ShouldLogOut(currTime) && !m_playerLoading))
LogoutPlayer(true);
///- If necessary, kick the player from the character select screen
if (IsConnectionIdle())
return false;
if (!m_Socket)
return false; //Will remove this session from the world session map