diff options
author | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2013-04-27 21:40:57 +0200 |
---|---|---|
committer | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2013-04-27 21:40:57 +0200 |
commit | 08e14b3932df9d176c90930ea4d55fa802e10965 (patch) | |
tree | 557c86d7e90f673511e33782884165c508ff6089 | |
parent | Noise3D: Made settable through INI, added slight height control, added basic compositing (diff) | |
download | cuberite-08e14b3932df9d176c90930ea4d55fa802e10965.tar cuberite-08e14b3932df9d176c90930ea4d55fa802e10965.tar.gz cuberite-08e14b3932df9d176c90930ea4d55fa802e10965.tar.bz2 cuberite-08e14b3932df9d176c90930ea4d55fa802e10965.tar.lz cuberite-08e14b3932df9d176c90930ea4d55fa802e10965.tar.xz cuberite-08e14b3932df9d176c90930ea4d55fa802e10965.tar.zst cuberite-08e14b3932df9d176c90930ea4d55fa802e10965.zip |
Diffstat (limited to '')
-rw-r--r-- | source/ChunkMap.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/source/ChunkMap.cpp b/source/ChunkMap.cpp index 6be49e399..7a7eeb25a 100644 --- a/source/ChunkMap.cpp +++ b/source/ChunkMap.cpp @@ -39,10 +39,11 @@ cChunkMap::cChunkMap(cWorld * a_World ) cChunkMap::~cChunkMap() { cCSLock Lock(m_CSLayers); - for (cChunkLayerList::iterator itr = m_Layers.begin(); itr != m_Layers.end(); ++itr) + while (!m_Layers.empty()) { - delete *itr; - } // for itr - m_Layers[] + delete m_Layers.back(); + m_Layers.pop_back(); // Must pop, because further chunk deletions query the chunkmap for entities and that would touch deleted data + } } @@ -1973,6 +1974,7 @@ cChunkMap::cChunkLayer::~cChunkLayer() for (int i = 0; i < ARRAYCOUNT(m_Chunks); ++i) { delete m_Chunks[i]; + m_Chunks[i] = NULL; // // Must zero out, because further chunk deletions query the chunkmap for entities and that would touch deleted data } // for i - m_Chunks[] } |