Skip to content

Commit

Permalink
Revert "TITANIC: Fix memory leak due to save thumbnail changes"
Browse files Browse the repository at this point in the history
This was a miss in commit 00e59a3. 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!
  • Loading branch information
bonki committed Apr 22, 2018
1 parent ab3f397 commit b1b83ac
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions engines/titanic/core/project_item.cpp
Expand Up @@ -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;
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion engines/titanic/detection.cpp
Expand Up @@ -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();
}
Expand Down

0 comments on commit b1b83ac

Please sign in to comment.