aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsapier <Sapier at GMX dot net>2013-04-07 21:01:19 +0200
committerkwolekr <kwolekr@minetest.net>2013-04-09 02:34:11 -0400
commit7d002b60ff3d672d141e0de65702c8af5b60f83a (patch)
tree7d8a7b7fcb872f18385d8a1447304d98274e51ca
parent04c3b17c780f78fcaa23af8187b5e5e30ff8fcab (diff)
downloadminetest-7d002b60ff3d672d141e0de65702c8af5b60f83a.tar.gz
minetest-7d002b60ff3d672d141e0de65702c8af5b60f83a.tar.bz2
minetest-7d002b60ff3d672d141e0de65702c8af5b60f83a.zip
fix emergemanager memory leaks
-rw-r--r--src/emerge.cpp16
-rw-r--r--src/map.cpp2
2 files changed, 17 insertions, 1 deletions
diff --git a/src/emerge.cpp b/src/emerge.cpp
index 499aaf291..9d3f94d48 100644
--- 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 a8201f3ee..c4884a45a 100644
--- 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)