summaryrefslogtreecommitdiff
path: root/src/search/SearchController.cpp
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2012-01-27 22:01:22 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-01-27 22:01:22 (GMT)
commit58ba7f8800403c572bae99115facc808c6dc34a3 (patch)
tree3a9a80114ac7aecc4251597eee5385f762fd3e56 /src/search/SearchController.cpp
parent07525180c2f8065c61dfd38bb273ff0f0a8abc85 (diff)
downloadpowder-58ba7f8800403c572bae99115facc808c6dc34a3.zip
powder-58ba7f8800403c572bae99115facc808c6dc34a3.tar.gz
Stop freeing memory twice, also clear signs correctly
Diffstat (limited to 'src/search/SearchController.cpp')
-rw-r--r--src/search/SearchController.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/search/SearchController.cpp b/src/search/SearchController.cpp
index 96f759e..2102a7d 100644
--- a/src/search/SearchController.cpp
+++ b/src/search/SearchController.cpp
@@ -12,10 +12,9 @@ public:
OpenCallback(SearchController * cc_) { cc = cc_; }
virtual void ControllerExit()
{
- if(cc->activePreview->GetDoOpen())
+ if(cc->activePreview->GetDoOpen() && cc->activePreview->GetSave())
{
cc->searchModel->SetLoadedSave(new Save(*(cc->activePreview->GetSave())));
- cc->Exit();
}
}
};
@@ -48,6 +47,10 @@ void SearchController::Update()
{
delete activePreview;
activePreview = NULL;
+ if(searchModel->GetLoadedSave())
+ {
+ Exit();
+ }
}
}