From df0ecc6c078cf06c5aba025bb8d77569ca91c748 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Sat, 8 Feb 2014 22:33:42 +0100 Subject: [PATCH] Fixed lighting thread queueing. --- src/LightingThread.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/LightingThread.cpp b/src/LightingThread.cpp index b665066ee..8fbfb29db 100644 --- a/src/LightingThread.cpp +++ b/src/LightingThread.cpp @@ -136,11 +136,13 @@ void cLightingThread::QueueChunk(int a_ChunkX, int a_ChunkZ, cChunkCoordCallback ASSERT(m_World != NULL); // Did you call Start() properly? cChunkStay * ChunkStay = new cLightingChunkStay(*this, a_ChunkX, a_ChunkZ, a_CallbackAfter); + { + cCSLock Lock(m_CS); + m_PendingQueue.push_back(ChunkStay); + } ChunkStay->Enable(*m_World->GetChunkMap()); // The ChunkStay will enqueue itself using the QueueChunkStay() once it is fully loaded // In the meantime, put it into the PendingQueue so that it can be removed when stopping the thread - cCSLock Lock(m_CS); - m_PendingQueue.push_back(ChunkStay); }