Only free GameView if it can be closed
This commit is contained in:
parent
fea71ec69b
commit
b8b5f91e20
@ -193,10 +193,6 @@ GameController::~GameController()
|
|||||||
{
|
{
|
||||||
delete options;
|
delete options;
|
||||||
}
|
}
|
||||||
if(ui::Engine::Ref().GetWindow() == gameView)
|
|
||||||
{
|
|
||||||
ui::Engine::Ref().CloseWindow();
|
|
||||||
}
|
|
||||||
//deleted here because it refuses to be deleted when deleted from gameModel even with the same code
|
//deleted here because it refuses to be deleted when deleted from gameModel even with the same code
|
||||||
std::deque<Snapshot*> history = gameModel->GetHistory();
|
std::deque<Snapshot*> history = gameModel->GetHistory();
|
||||||
for(std::deque<Snapshot*>::iterator iter = history.begin(), end = history.end(); iter != end; ++iter)
|
for(std::deque<Snapshot*>::iterator iter = history.begin(), end = history.end(); iter != end; ++iter)
|
||||||
@ -214,7 +210,11 @@ GameController::~GameController()
|
|||||||
delete *iter;
|
delete *iter;
|
||||||
}
|
}
|
||||||
delete gameModel;
|
delete gameModel;
|
||||||
delete gameView;
|
if(ui::Engine::Ref().GetWindow() == gameView)
|
||||||
|
{
|
||||||
|
ui::Engine::Ref().CloseWindow();
|
||||||
|
delete gameView;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GameController::HistoryRestore()
|
void GameController::HistoryRestore()
|
||||||
|
Reference in New Issue
Block a user