From 389062a1ed8063d82ddd611f3426c9b2b088e0fc Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Thu, 22 Mar 2012 15:53:40 +0000 Subject: Fixed a deadlock by removing clients from all chunks upon their exit, not using the clients chunklists. git-svn-id: http://mc-server.googlecode.com/svn/trunk@426 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/cClientHandle.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'source/cClientHandle.cpp') diff --git a/source/cClientHandle.cpp b/source/cClientHandle.cpp index d7b1aa55c..3df4b36b2 100644 --- a/source/cClientHandle.cpp +++ b/source/cClientHandle.cpp @@ -461,14 +461,17 @@ void cClientHandle::StreamChunk(int a_ChunkX, int a_ChunkY, int a_ChunkZ) // Removes the client from all chunks. Used when switching worlds or destroying the player void cClientHandle::RemoveFromAllChunks() { - cCSLock Lock(m_CSChunkLists); cWorld * World = m_Player->GetWorld(); if (World != NULL) { - World->RemoveClientFromChunks(this, m_LoadedChunks); + World->RemoveClientFromChunks(this); + } + + { + cCSLock Lock(m_CSChunkLists); + m_LoadedChunks.clear(); + m_ChunksToSend.clear(); } - m_LoadedChunks.clear(); - m_ChunksToSend.clear(); } -- cgit v1.2.3