Gameserver - Fixed minor merging isues
This commit is contained in:
parent
b17b542ebc
commit
168539da08
|
@ -34,6 +34,8 @@ namespace Utility
|
||||||
virtual bool IsEmpty();
|
virtual bool IsEmpty();
|
||||||
virtual void Swap( IQueue<Type> &queue );
|
virtual void Swap( IQueue<Type> &queue );
|
||||||
|
|
||||||
|
virtual void Clear();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
class Node
|
class Node
|
||||||
{
|
{
|
||||||
|
@ -216,6 +218,15 @@ namespace Utility
|
||||||
stdMutex.unlock();
|
stdMutex.unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template < typename Type >
|
||||||
|
void ThreadSafeQueue<Type>::Clear()
|
||||||
|
{
|
||||||
|
while (!IsEmpty())
|
||||||
|
{
|
||||||
|
Pop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,9 +62,10 @@ struct NetworkClient::PrivateData : public IThreadObject
|
||||||
}
|
}
|
||||||
~PrivateData()
|
~PrivateData()
|
||||||
{
|
{
|
||||||
|
this->thread.Terminate();
|
||||||
|
|
||||||
ShutdownWinSock();
|
ShutdownWinSock();
|
||||||
this->connection.Disconnect();
|
this->connection.Disconnect();
|
||||||
this->thread.Terminate();
|
|
||||||
this->owner = 0;
|
this->owner = 0;
|
||||||
this->parent = 0;
|
this->parent = 0;
|
||||||
}
|
}
|
||||||
|
@ -296,8 +297,11 @@ void NetworkClient::Disconnect()
|
||||||
{
|
{
|
||||||
if(!privateData) return;
|
if(!privateData) return;
|
||||||
|
|
||||||
|
this->privateData->sendQueue.Clear();
|
||||||
|
|
||||||
privateData->connection.Disconnect();
|
privateData->connection.Disconnect();
|
||||||
privateData->thread.Terminate();
|
privateData->thread.Terminate();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void NetworkClient::Send(CustomProtocolObject& protocol)
|
void NetworkClient::Send(CustomProtocolObject& protocol)
|
||||||
|
|
Loading…
Reference in New Issue