projects
/
oweals
/
minetest.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1bf9b25
)
Fix a memleak pointed by @Zeno- in MeshUpdateQueue
author
Loic Blot
<loic.blot@unix-experience.fr>
Tue, 16 May 2017 06:27:18 +0000
(08:27 +0200)
committer
Loic Blot
<loic.blot@unix-experience.fr>
Tue, 16 May 2017 06:27:18 +0000
(08:27 +0200)
This leak was introduced when added cache to MeshUpdateQueue and only occurs when leaving world.
src/mesh_generator_thread.cpp
patch
|
blob
|
history
diff --git
a/src/mesh_generator_thread.cpp
b/src/mesh_generator_thread.cpp
index 126bf6327e896f2f6d1ee08624e074e2b9a4361f..98173c788b4d525f5812478fb0ad56c69ba69b31 100644
(file)
--- 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;