diff options
author | Břetislav Štec <valsiterb@gmail.com> | 2015-08-02 01:31:57 +0200 |
---|---|---|
committer | kwolekr <kwolekr@minetest.net> | 2015-08-02 02:15:38 -0400 |
commit | ebe7b31538d44277db0eeccfddef13917baa2ee7 (patch) | |
tree | f45ac6c9faba43b0a46c230267ca5efbe3a6b099 | |
parent | 42cf5e972d1e27a92048712bc79806e1a088b96c (diff) | |
download | minetest-ebe7b31538d44277db0eeccfddef13917baa2ee7.tar.gz minetest-ebe7b31538d44277db0eeccfddef13917baa2ee7.tar.bz2 minetest-ebe7b31538d44277db0eeccfddef13917baa2ee7.zip |
src/client.cpp: Fix mapper memory leak
-rw-r--r-- | src/client.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/client.cpp b/src/client.cpp index fdabfa2d8..d4d3b6df6 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -291,7 +291,7 @@ Client::~Client() m_mesh_update_thread.Stop(); m_mesh_update_thread.Wait(); - while(!m_mesh_update_thread.m_queue_out.empty()) { + while (!m_mesh_update_thread.m_queue_out.empty()) { MeshUpdateResult r = m_mesh_update_thread.m_queue_out.pop_frontNoEx(); delete r.mesh; } @@ -300,20 +300,22 @@ Client::~Client() delete m_inventory_from_server; // Delete detached inventories - for(std::map<std::string, Inventory*>::iterator + for (std::map<std::string, Inventory*>::iterator i = m_detached_inventories.begin(); - i != m_detached_inventories.end(); i++){ + i != m_detached_inventories.end(); ++i) { delete i->second; } // cleanup 3d model meshes on client shutdown while (m_device->getSceneManager()->getMeshCache()->getMeshCount() != 0) { - scene::IAnimatedMesh * mesh = + scene::IAnimatedMesh *mesh = m_device->getSceneManager()->getMeshCache()->getMeshByIndex(0); if (mesh != NULL) m_device->getSceneManager()->getMeshCache()->removeMesh(mesh); } + + delete m_mapper; } void Client::connect(Address address, |