[Scummvm-git-logs] scummvm master -> ab3f397e2d3f68eddc0cf66b67ff781cbb2e399d

dreammaster dreammaster at scummvm.org
Sun Apr 22 17:44:20 CEST 2018


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
ab3f397e2d TITANIC: Fix memory leak due to save thumbnail changes


Commit: ab3f397e2d3f68eddc0cf66b67ff781cbb2e399d
    https://github.com/scummvm/scummvm/commit/ab3f397e2d3f68eddc0cf66b67ff781cbb2e399d
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2018-04-22T11:44:15-04:00

Commit Message:
TITANIC: Fix memory leak due to save thumbnail changes

Changed paths:
    engines/titanic/core/project_item.cpp
    engines/titanic/detection.cpp


diff --git a/engines/titanic/core/project_item.cpp b/engines/titanic/core/project_item.cpp
index 6da891c..424562f 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 skipThumbnail) {
+bool CProjectItem::readSavegameHeader(SimpleFile *file, TitanicSavegameHeader &header, bool loadThumbnail) {
 	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, skipThumbnail))
+	if (!Graphics::loadThumbnail(*file, header._thumbnail, !loadThumbnail))
 		return false;
 
 	// Read in save date/time
diff --git a/engines/titanic/detection.cpp b/engines/titanic/detection.cpp
index c98fbbd..07a17ae 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, false)) {
+		if (!Titanic::CProjectItem::readSavegameHeader(&file, header, true)) {
 			file.close();
 			return SaveStateDescriptor();
 		}





More information about the Scummvm-git-logs mailing list