From 582ee15d8e861efb9cc843963a95c087dae91bcc Mon Sep 17 00:00:00 2001 From: Loic Blot Date: Tue, 16 May 2017 08:27:18 +0200 Subject: Fix a memleak pointed by @Zeno- in MeshUpdateQueue This leak was introduced when added cache to MeshUpdateQueue and only occurs when leaving world. --- src/mesh_generator_thread.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/mesh_generator_thread.cpp') 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::iterator i = m_cache.begin(); + i != m_cache.end(); ++i) { + delete i->second; + } + for (std::vector::iterator i = m_queue.begin(); i != m_queue.end(); ++i) { QueuedMeshUpdate *q = *i; -- cgit v1.2.3