fix emergemanager memory leaks

This commit is contained in:
sapier 2013-04-07 21:01:19 +02:00 committed by kwolekr
parent 04c3b17c78
commit 7d002b60ff
2 changed files with 17 additions and 1 deletions

@ -96,9 +96,23 @@ EmergeManager::~EmergeManager() {
delete emergethread[i]; delete emergethread[i];
delete mapgen[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 biomedef;
delete params;
} }

@ -2494,6 +2494,8 @@ ServerMap::~ServerMap()
delete chunk; delete chunk;
} }
#endif #endif
delete m_mgparams;
} }
bool ServerMap::initBlockMake(BlockMakeData *data, v3s16 blockpos) bool ServerMap::initBlockMake(BlockMakeData *data, v3s16 blockpos)