- a better attempt to safely end games and hopefully fix the delete cells bug once for all

This commit is contained in:
Mark Vejvoda 2010-08-04 20:07:39 +00:00
parent 860b00df44
commit a7c86fb86b

View File

@ -78,6 +78,17 @@ World::~World() {
ExploredCellsLookupItemCache.clear();
ExploredCellsLookupItemCacheTimer.clear();
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
for(int i= 0; i<factions.size(); ++i){
factions[i].end();
}
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
factions.clear();
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
delete techTree;
techTree = NULL;
@ -103,6 +114,7 @@ void World::end(){
for(int i= 0; i<factions.size(); ++i){
factions[i].end();
}
factions.clear();
fogOfWarOverride = false;
//stats will be deleted by BattleEnd
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);