From 9cebc9157cf43ba639227b9d79b980b3613dda1e Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Mon, 10 Feb 2014 22:47:10 +0100 Subject: Rewritten Lua ChunkStay API into a single function, cWorld:ChunkStay(). This fixes problems with indeterminate class object lifespan (Lua-GC) and forgetting to disable it or keep it until ready. --- src/LightingThread.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/LightingThread.cpp') diff --git a/src/LightingThread.cpp b/src/LightingThread.cpp index 688f119ff..9c81d004d 100644 --- a/src/LightingThread.cpp +++ b/src/LightingThread.cpp @@ -548,9 +548,21 @@ cLightingThread::cLightingChunkStay::cLightingChunkStay(cLightingThread & a_Ligh -void cLightingThread::cLightingChunkStay::OnAllChunksAvailable(void) +bool cLightingThread::cLightingChunkStay::OnAllChunksAvailable(void) { m_LightingThread.QueueChunkStay(*this); + + // Keep the ChunkStay alive: + return false; +} + + + + + +void cLightingThread::cLightingChunkStay::OnDisabled(void) +{ + // Nothing needed in this callback } -- cgit v1.2.3