projects
/
oweals
/
minetest.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1369503
)
Fix memory leak in MeshUpdateThread
author
PilzAdam
<pilzadam@minetest.net>
Fri, 17 May 2013 23:52:18 +0000
(
01:52
+0200)
committer
PilzAdam
<pilzadam@minetest.net>
Fri, 17 May 2013 23:52:18 +0000
(
01:52
+0200)
src/client.cpp
patch
|
blob
|
history
diff --git
a/src/client.cpp
b/src/client.cpp
index 929ed0eabdab48358a9c20841b164f802e4e47cd..533c40ab2c8a6576a3803a9ebdb881b5f8248ba3 100644
(file)
--- 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)
{