From b1b83ac9547e209da3d588487ee6427b1c9d2995 Mon Sep 17 00:00:00 2001 From: Adrian Frühwirth Date: Sun, 22 Apr 2018 22:13:45 +0200 Subject: Revert "TITANIC: Fix memory leak due to save thumbnail changes" This was a miss in commit 00e59a3122. The new parameter was supposed to be called skipThumbnail and default to true instead. For consistency's sake (the rest of the tree uses skipThumbnail, not loadThumbnail) I'm reverting this and will separately update the declaration to how it should have been from the beginning. Thanks dreammaster! --- engines/titanic/core/project_item.cpp | 4 ++-- engines/titanic/detection.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/engines/titanic/core/project_item.cpp b/engines/titanic/core/project_item.cpp index 424562ffef..6da891c417 100644 --- a/engines/titanic/core/project_item.cpp +++ b/engines/titanic/core/project_item.cpp @@ -495,7 +495,7 @@ SaveStateList CProjectItem::getSavegameList(const Common::String &target) { return saveList; } -bool CProjectItem::readSavegameHeader(SimpleFile *file, TitanicSavegameHeader &header, bool loadThumbnail) { +bool CProjectItem::readSavegameHeader(SimpleFile *file, TitanicSavegameHeader &header, bool skipThumbnail) { char saveIdentBuffer[SAVEGAME_STR_SIZE + 1]; header._thumbnail = nullptr; header._totalFrames = 0; @@ -518,7 +518,7 @@ bool CProjectItem::readSavegameHeader(SimpleFile *file, TitanicSavegameHeader &h while ((ch = (char)file->readByte()) != '\0') header._saveName += ch; // Get the thumbnail - if (!Graphics::loadThumbnail(*file, header._thumbnail, !loadThumbnail)) + if (!Graphics::loadThumbnail(*file, header._thumbnail, skipThumbnail)) return false; // Read in save date/time diff --git a/engines/titanic/detection.cpp b/engines/titanic/detection.cpp index 07a17ae779..c98fbbdade 100644 --- a/engines/titanic/detection.cpp +++ b/engines/titanic/detection.cpp @@ -156,7 +156,7 @@ SaveStateDescriptor TitanicMetaEngine::querySaveMetaInfos(const char *target, in file.open(f); Titanic::TitanicSavegameHeader header; - if (!Titanic::CProjectItem::readSavegameHeader(&file, header, true)) { + if (!Titanic::CProjectItem::readSavegameHeader(&file, header, false)) { file.close(); return SaveStateDescriptor(); } -- cgit v1.2.3