From: sapier Date: Sun, 7 Apr 2013 19:01:19 +0000 (+0200) Subject: fix emergemanager memory leaks X-Git-Url: http://81.2.79.47:8989/gitweb/?a=commitdiff_plain;h=7d002b60ff3d672d141e0de65702c8af5b60f83a;p=zefram%2Fminetest%2Fminetest_engine.git fix emergemanager memory leaks --- diff --git a/src/emerge.cpp b/src/emerge.cpp index 499aaf29..9d3f94d4 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::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 a8201f3e..c4884a45 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)