- another attempt to fix game end crash for ultifd

This commit is contained in:
Mark Vejvoda 2010-08-04 16:56:24 +00:00
parent bc3e6bc64e
commit c63283ffac
5 changed files with 36 additions and 1 deletions

View File

@ -110,7 +110,7 @@ Game::~Game(){
world.end(); //must die before selection because of referencers
//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__);
}
// ==================== init and load ====================
@ -555,6 +555,7 @@ void Game::update(){
errorMessageBox.getEnabled() == false) {
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
quitGame();
return;
}
//update auto test

View File

@ -344,7 +344,12 @@ void Program::setState(ProgramState *programState, bool cleanupOldState)
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
delete this->programState;
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
this->programState = NULL;
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
}
}

View File

@ -31,6 +31,26 @@ namespace Glest{ namespace Game{
// class Faction
// =====================================================
Faction::Faction() {
texture = NULL;
}
Faction::~Faction() {
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
Renderer &renderer= Renderer::getInstance();
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
//renderer.endTexture(rsGame,texture);
//texture->end();
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
//delete texture;
texture = NULL;
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
}
void Faction::init(
const FactionType *factionType, ControlType control, TechTree *techTree, Game *game,
int factionIndex, int teamIndex, int startLocationIndex, bool thisFaction, bool giveResources)

View File

@ -76,6 +76,9 @@ private:
bool thisFaction;
public:
Faction();
~Faction();
void init(
const FactionType *factionType, ControlType control, TechTree *techTree, Game *game,
int factionIndex, int teamIndex, int startLocationIndex, bool thisFaction, bool giveResources);

View File

@ -80,8 +80,14 @@ World::~World() {
delete techTree;
techTree = NULL;
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
delete routePlanner;
routePlanner = 0;
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
delete cartographer;
cartographer = 0;
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);