Skip to content

Commit 582ee15

Browse files
committedMay 16, 2017
Fix a memleak pointed by @Zeno- in MeshUpdateQueue
This leak was introduced when added cache to MeshUpdateQueue and only occurs when leaving world.
1 parent 1bf9b25 commit 582ee15

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed
 

Diff for: ‎src/mesh_generator_thread.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,11 @@ MeshUpdateQueue::~MeshUpdateQueue()
8383
{
8484
MutexAutoLock lock(m_mutex);
8585

86+
for (std::map<v3s16, CachedMapBlockData *>::iterator i = m_cache.begin();
87+
i != m_cache.end(); ++i) {
88+
delete i->second;
89+
}
90+
8691
for (std::vector<QueuedMeshUpdate*>::iterator i = m_queue.begin();
8792
i != m_queue.end(); ++i) {
8893
QueuedMeshUpdate *q = *i;

1 commit comments

Comments
 (1)

Zeno- commented on May 16, 2017

@Zeno-
Contributor

Thanks @nerzhul

Please sign in to comment.