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