Skip to content

Commit

Permalink
Fix a memleak pointed by @Zeno- in MeshUpdateQueue
Browse files Browse the repository at this point in the history
This leak was introduced when added cache to MeshUpdateQueue and only occurs when leaving world.
  • Loading branch information
nerzhul committed May 16, 2017
1 parent 1bf9b25 commit 582ee15
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/mesh_generator_thread.cpp
Expand Up @@ -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;
Expand Down

1 comment on commit 582ee15

@Zeno-
Copy link
Contributor

@Zeno- Zeno- commented on 582ee15 May 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @nerzhul

Please sign in to comment.