diff options
Diffstat (limited to 'src/game')
| -rw-r--r-- | src/game/GameController.cpp | 10 | ||||
| -rw-r--r-- | src/game/GameController.h | 2 |
2 files changed, 10 insertions, 2 deletions
diff --git a/src/game/GameController.cpp b/src/game/GameController.cpp index d8cff8b..571833a 100644 --- a/src/game/GameController.cpp +++ b/src/game/GameController.cpp @@ -9,7 +9,8 @@ using namespace std; -GameController::GameController() +GameController::GameController(): + search(NULL) { gameView = new GameView(); gameModel = new GameModel(); @@ -22,6 +23,11 @@ GameController::GameController() GameController::~GameController() { + if(search) + { + ui::Engine::Ref().CloseWindow(); + delete search; + } delete gameView; delete gameModel; } @@ -70,6 +76,6 @@ void GameController::SetPaused(bool pauseState) void GameController::OpenSearch() { - SearchController * search = new SearchController(); + search = new SearchController(); ui::Engine::Ref().ShowWindow(search->GetView()); } diff --git a/src/game/GameController.h b/src/game/GameController.h index 63d8e5e..c2c578d 100644 --- a/src/game/GameController.h +++ b/src/game/GameController.h @@ -6,6 +6,7 @@ #include "GameModel.h" #include "interface/Point.h" #include "simulation/Simulation.h" +#include "search/SearchController.h" using namespace std; @@ -17,6 +18,7 @@ private: //Simulation * sim; GameView * gameView; GameModel * gameModel; + SearchController * search; public: GameController(); ~GameController(); |
