From bd296673558fe75fee039bd27b0a71960dc426bc Mon Sep 17 00:00:00 2001 From: Simon Robertshaw Date: Wed, 8 Aug 2012 20:21:59 +0100 Subject: [PATCH] Do not delete given savefile in GameModel::SetSaveFile, behaviour should be similar to GameModel::SetSave in terms of managing memory in given pointer --- src/game/GameController.cpp | 1 + src/game/GameModel.cpp | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/src/game/GameController.cpp b/src/game/GameController.cpp index cea50cb5f..06ba1d492 100644 --- a/src/game/GameController.cpp +++ b/src/game/GameController.cpp @@ -717,6 +717,7 @@ void GameController::OpenLocalBrowse() virtual void FileSelected(SaveFile* file) { c->LoadSaveFile(file); + delete file; } }; new FileBrowserActivity(LOCAL_SAVE_DIR PATH_SEP, new LocalSaveOpenCallback(this)); diff --git a/src/game/GameModel.cpp b/src/game/GameModel.cpp index a53bba277..91ddd53e2 100644 --- a/src/game/GameModel.cpp +++ b/src/game/GameModel.cpp @@ -398,7 +398,6 @@ void GameModel::SetSaveFile(SaveFile * newSave) sim->clear_sim(); sim->Load(saveData); } - delete newSave; notifySaveChanged(); UpdateQuickOptions();