aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLoic Blot <loic.blot@unix-experience.fr>2017-05-16 08:27:18 +0200
committerLoic Blot <loic.blot@unix-experience.fr>2017-05-16 08:27:18 +0200
commit582ee15d8e861efb9cc843963a95c087dae91bcc (patch)
tree0f99117eec72ba940a275645908e7b82281af7e6 /src
parent1bf9b25fb47d086a3f323c86278de7c235855fb0 (diff)
downloadminetest-582ee15d8e861efb9cc843963a95c087dae91bcc.tar.gz
minetest-582ee15d8e861efb9cc843963a95c087dae91bcc.tar.bz2
minetest-582ee15d8e861efb9cc843963a95c087dae91bcc.zip
Fix a memleak pointed by @Zeno- in MeshUpdateQueue
This leak was introduced when added cache to MeshUpdateQueue and only occurs when leaving world.
Diffstat (limited to 'src')
-rw-r--r--src/mesh_generator_thread.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mesh_generator_thread.cpp b/src/mesh_generator_thread.cpp
index 126bf6327..98173c788 100644
--- a/src/mesh_generator_thread.cpp
+++ b/src/mesh_generator_thread.cpp
@@ -83,6 +83,11 @@ MeshUpdateQueue::~MeshUpdateQueue()
{
MutexAutoLock lock(m_mutex);
+ for (std::map<v3s16, CachedMapBlockData *>::iterator i = m_cache.begin();
+ i != m_cache.end(); ++i) {
+ delete i->second;
+ }
+
for (std::vector<QueuedMeshUpdate*>::iterator i = m_queue.begin();
i != m_queue.end(); ++i) {
QueuedMeshUpdate *q = *i;