diff options
author | Paul Gilbert | 2017-09-18 21:00:39 -0400 |
---|---|---|
committer | Paul Gilbert | 2017-09-18 21:00:39 -0400 |
commit | f6ef3cbc9e6873417af71ce9cf0b841b6e85e9d0 (patch) | |
tree | 0e754936e9c3bfd9cf7294d8814f93ca9b887911 /engines/titanic/core/project_item.cpp | |
parent | 31c9cca0fd8a4dea793e6b3bf3fd27abd6be934d (diff) | |
download | scummvm-rg350-f6ef3cbc9e6873417af71ce9cf0b841b6e85e9d0.tar.gz scummvm-rg350-f6ef3cbc9e6873417af71ce9cf0b841b6e85e9d0.tar.bz2 scummvm-rg350-f6ef3cbc9e6873417af71ce9cf0b841b6e85e9d0.zip |
TITANIC: Fix memory leak on thumbnails when loading savegames
Diffstat (limited to 'engines/titanic/core/project_item.cpp')
-rw-r--r-- | engines/titanic/core/project_item.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/engines/titanic/core/project_item.cpp b/engines/titanic/core/project_item.cpp index 94689f1600..16fe0e6ec1 100644 --- a/engines/titanic/core/project_item.cpp +++ b/engines/titanic/core/project_item.cpp @@ -190,7 +190,11 @@ void CProjectItem::loadGame(int slotId) { // Load the savegame header in TitanicSavegameHeader header; readSavegameHeader(&file, header); - delete header._thumbnail; + if (header._thumbnail) { + header._thumbnail->free(); + delete header._thumbnail; + } + g_vm->_events->setTotalPlayTicks(header._totalFrames); // Load the contents in |