Fix a memleak pointed by @Zeno- in MeshUpdateQueue

This leak was introduced when added cache to MeshUpdateQueue and only occurs when leaving world.
master
Loic Blot 2017-05-16 08:27:18 +02:00
parent 1bf9b25fb4
commit 582ee15d8e
No known key found for this signature in database
GPG Key ID: EFAA458E8C153987
1 changed files with 5 additions and 0 deletions

View File

@ -83,6 +83,11 @@ MeshUpdateQueue::~MeshUpdateQueue()
{ {
MutexAutoLock lock(m_mutex); 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(); for (std::vector<QueuedMeshUpdate*>::iterator i = m_queue.begin();
i != m_queue.end(); ++i) { i != m_queue.end(); ++i) {
QueuedMeshUpdate *q = *i; QueuedMeshUpdate *q = *i;