diff options
author | PilzAdam <pilzadam@minetest.net> | 2013-05-18 01:52:18 +0200 |
---|---|---|
committer | PilzAdam <pilzadam@minetest.net> | 2013-05-18 01:52:18 +0200 |
commit | 9397b5de083fabe2e93c55de5bf90e5c75bbe9c1 (patch) | |
tree | 99a9d4318280a59873f51da0cb8f992323eaedf6 /src/client.cpp | |
parent | 1369503aba1ae0c64e6c25b32cc5552bbdead8fb (diff) | |
download | minetest-9397b5de083fabe2e93c55de5bf90e5c75bbe9c1.tar.gz minetest-9397b5de083fabe2e93c55de5bf90e5c75bbe9c1.tar.bz2 minetest-9397b5de083fabe2e93c55de5bf90e5c75bbe9c1.zip |
Fix memory leak in MeshUpdateThread
Diffstat (limited to 'src/client.cpp')
-rw-r--r-- | src/client.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/client.cpp b/src/client.cpp index 929ed0eab..533c40ab2 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -350,6 +350,11 @@ Client::~Client() m_mesh_update_thread.setRun(false); while(m_mesh_update_thread.IsRunning()) sleep_ms(100); + while(!m_mesh_update_thread.m_queue_out.empty()) { + MeshUpdateResult r = m_mesh_update_thread.m_queue_out.pop_front(); + delete r.mesh; + } + delete m_inventory_from_server; @@ -757,6 +762,8 @@ void Client::step(float dtime) // Replace with the new mesh block->mesh = r.mesh; + } else { + delete r.mesh; } if(r.ack_block_to_server) { |