From 75b7244f0565170ccc40a3ebdf277945e5191be8 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Sat, 12 Apr 2014 22:15:09 +0200 Subject: Fixed chunkstays not being removed on auto-delete. Fixes #837. --- src/ChunkStay.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/ChunkStay.cpp') diff --git a/src/ChunkStay.cpp b/src/ChunkStay.cpp index 6b1d5ee34..a35ccf58c 100644 --- a/src/ChunkStay.cpp +++ b/src/ChunkStay.cpp @@ -97,8 +97,9 @@ void cChunkStay::Disable(void) { ASSERT(m_ChunkMap != NULL); - m_ChunkMap->DelChunkStay(*this); + cChunkMap * ChunkMap = m_ChunkMap; m_ChunkMap = NULL; + ChunkMap->DelChunkStay(*this); } -- cgit v1.2.3 From 34cf058b0257587456632536a54db0d4e119dae1 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Sat, 12 Apr 2014 22:35:04 +0200 Subject: ChunkStay must be disabled while being deleted. Fixes #758. --- src/ChunkStay.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/ChunkStay.cpp') diff --git a/src/ChunkStay.cpp b/src/ChunkStay.cpp index a35ccf58c..b5002a63d 100644 --- a/src/ChunkStay.cpp +++ b/src/ChunkStay.cpp @@ -31,10 +31,7 @@ cChunkStay::~cChunkStay() void cChunkStay::Clear(void) { - if (m_ChunkMap != NULL) - { - Disable(); - } + ASSERT(m_ChunkMap == NULL); m_Chunks.clear(); } -- cgit v1.2.3