Fix memory leak in MeshUpdateThread

This commit is contained in:
PilzAdam 2013-05-18 01:52:18 +02:00
parent 1369503aba
commit 9397b5de08

@ -350,6 +350,11 @@ Client::~Client()
m_mesh_update_thread.setRun(false); m_mesh_update_thread.setRun(false);
while(m_mesh_update_thread.IsRunning()) while(m_mesh_update_thread.IsRunning())
sleep_ms(100); 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; delete m_inventory_from_server;
@ -757,6 +762,8 @@ void Client::step(float dtime)
// Replace with the new mesh // Replace with the new mesh
block->mesh = r.mesh; block->mesh = r.mesh;
} else {
delete r.mesh;
} }
if(r.ack_block_to_server) if(r.ack_block_to_server)
{ {