Prevent saves from being loaded twice by the Save browser

This commit is contained in:
Simon Robertshaw
2012-12-14 19:44:16 +00:00
parent e5feefa419
commit 31c0666961
3 changed files with 7 additions and 0 deletions

View File

@@ -40,6 +40,7 @@ public:
try try
{ {
cc->gameModel->SetSave(cc->search->GetLoadedSave()); cc->gameModel->SetSave(cc->search->GetLoadedSave());
cc->search->ReleaseLoadedSave();
} }
catch(GameModelException & ex) catch(GameModelException & ex)
{ {

View File

@@ -55,6 +55,11 @@ SaveInfo * SearchController::GetLoadedSave()
return searchModel->GetLoadedSave(); return searchModel->GetLoadedSave();
} }
void SearchController::ReleaseLoadedSave()
{
searchModel->SetLoadedSave(NULL);
}
void SearchController::Update() void SearchController::Update()
{ {
if(!nextQueryDone && nextQueryTime < clock()) if(!nextQueryDone && nextQueryTime < clock())

View File

@@ -44,6 +44,7 @@ public:
void RemoveSelected(); void RemoveSelected();
void UnpublishSelected(); void UnpublishSelected();
void FavouriteSelected(); void FavouriteSelected();
void ReleaseLoadedSave();
SaveInfo * GetLoadedSave(); SaveInfo * GetLoadedSave();
}; };