[8463] Fixed race conditions in LockedQueue.

Signed-off-by: ApoC <apoc@nymfe.net>
This commit is contained in:
XTZGZoReX 2009-08-30 23:23:46 +02:00 committed by ApoC
parent 7f444189c6
commit 66ffd80ed2
6 changed files with 42 additions and 86 deletions

View file

@ -69,11 +69,9 @@ WorldSession::~WorldSession()
}
///- empty incoming packet queue
while(!_recvQueue.empty())
{
WorldPacket *packet = _recvQueue.next ();
WorldPacket* packet;
while(_recvQueue.next(packet))
delete packet;
}
}
void WorldSession::SizeError(WorldPacket const& packet, uint32 size) const
@ -163,10 +161,9 @@ bool WorldSession::Update(uint32 /*diff*/)
{
///- Retrieve packets from the receive queue and call the appropriate handlers
/// not proccess packets if socket already closed
while (!_recvQueue.empty() && m_Socket && !m_Socket->IsClosed ())
WorldPacket* packet;
while (_recvQueue.next(packet) && m_Socket && !m_Socket->IsClosed ())
{
WorldPacket *packet = _recvQueue.next();
/*#if 1
sLog.outError( "MOEP: %s (0x%.4X)",
LookupOpcodeName(packet->GetOpcode()),