summaryrefslogtreecommitdiff
path: root/src/game
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2012-01-21 18:51:28 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-01-21 18:51:28 (GMT)
commit1cee908c165ead0fcecba4519d4584f3935988b5 (patch)
treec03981effdc5543fd9e50f70aab678c9631dbbcd /src/game
parent8ec6aae617525d13697d1c2a612ac37be0f341d5 (diff)
downloadpowder-1cee908c165ead0fcecba4519d4584f3935988b5.zip
powder-1cee908c165ead0fcecba4519d4584f3935988b5.tar.gz
Fix thumbnail crash, turns out SaveButton was storing a Thumbnail pointer, not a Thumbnail as I thought
Diffstat (limited to 'src/game')
-rw-r--r--src/game/GameController.cpp10
-rw-r--r--src/game/GameController.h2
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();