diff options
author | LogicParrot <LogicParrot@users.noreply.github.com> | 2016-05-01 23:18:21 +0200 |
---|---|---|
committer | LogicParrot <LogicParrot@users.noreply.github.com> | 2016-05-01 23:18:21 +0200 |
commit | 36754f20f8397f517e7d06673b017fc06afce09a (patch) | |
tree | e4fe6a4f52543c2ec25f17c8955c17306ea1bd72 /src/ChunkMap.cpp | |
parent | Proper minecart DoSetSpeed Override (#3174) (diff) | |
download | cuberite-36754f20f8397f517e7d06673b017fc06afce09a.tar cuberite-36754f20f8397f517e7d06673b017fc06afce09a.tar.gz cuberite-36754f20f8397f517e7d06673b017fc06afce09a.tar.bz2 cuberite-36754f20f8397f517e7d06673b017fc06afce09a.tar.lz cuberite-36754f20f8397f517e7d06673b017fc06afce09a.tar.xz cuberite-36754f20f8397f517e7d06673b017fc06afce09a.tar.zst cuberite-36754f20f8397f517e7d06673b017fc06afce09a.zip |
Diffstat (limited to 'src/ChunkMap.cpp')
-rw-r--r-- | src/ChunkMap.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/ChunkMap.cpp b/src/ChunkMap.cpp index 02666eaf6..7d1685210 100644 --- a/src/ChunkMap.cpp +++ b/src/ChunkMap.cpp @@ -51,6 +51,19 @@ cChunkMap::cChunkMap(cWorld * a_World) : +cChunkMap::~cChunkMap() +{ + // Explicitly destroy all chunks and ChunkLayers, so that they're guaranteed to be + // destroyed before other internals. This fixes crashes on stopping the server. + // because the chunk destructor deletes entities and those may access the chunkmap. + // Also, the cChunkData destructor accesses the chunkMap's allocator. + m_Layers.clear(); +} + + + + + void cChunkMap::RemoveLayer(cChunkLayer * a_Layer) { cCSLock Lock(m_CSLayers); |