projects
/
zefram
/
minetest
/
minetest_engine.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
04c3b17
)
fix emergemanager memory leaks
author
sapier
<Sapier at GMX dot net>
Sun, 7 Apr 2013 19:01:19 +0000
(21:01 +0200)
committer
kwolekr
<kwolekr@minetest.net>
Tue, 9 Apr 2013 06:34:11 +0000
(
02:34
-0400)
src/emerge.cpp
patch
|
blob
|
history
src/map.cpp
patch
|
blob
|
history
diff --git
a/src/emerge.cpp
b/src/emerge.cpp
index 499aaf291916d962818f1bccd50967e0d957d33b..9d3f94d48428f5d9a97a86af268b7c0783d5592c 100644
(file)
--- a/
src/emerge.cpp
+++ b/
src/emerge.cpp
@@
-96,9
+96,23
@@
EmergeManager::~EmergeManager() {
delete emergethread[i];
delete mapgen[i];
}
+ emergethread.clear();
+
+ for (unsigned int i = 0; i < mapgen.size(); i++)
+ delete mapgen[i];
+ mapgen.clear();
+
+ for (unsigned int i = 0; i < ores.size(); i++)
+ delete ores[i];
+ ores.clear();
+ for (std::map<std::string, MapgenFactory *>::iterator iter = mglist.begin();
+ iter != mglist.end(); iter ++) {
+ delete iter->second;
+ }
+ mglist.clear();
+
delete biomedef;
- delete params;
}
diff --git
a/src/map.cpp
b/src/map.cpp
index a8201f3ee7cb0456c050e187e4df231837b8a9a6..c4884a45a12cdc3652ac2da5af01ca6f8943ad80 100644
(file)
--- a/
src/map.cpp
+++ b/
src/map.cpp
@@
-2494,6
+2494,8
@@
ServerMap::~ServerMap()
delete chunk;
}
#endif
+
+ delete m_mgparams;
}
bool ServerMap::initBlockMake(BlockMakeData *data, v3s16 blockpos)