[Scummvm-git-logs] scummvm master -> 10abb0c646fee1ddf516330ab4736c6ab087569e

bonki bonki at users.noreply.github.com
Sun Apr 22 22:47:14 CEST 2018


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

Summary:
b1b83ac954 Revert "TITANIC: Fix memory leak due to save thumbnail changes"
10abb0c646 TITANIC: Fix discrepancy between readSavegameHeader() declaration and definition


Commit: b1b83ac9547e209da3d588487ee6427b1c9d2995
    https://github.com/scummvm/scummvm/commit/b1b83ac9547e209da3d588487ee6427b1c9d2995
Author: Adrian Frühwirth (bonki at users.noreply.github.com)
Date: 2018-04-22T22:42:40+02:00

Commit Message:
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!

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 424562f..6da891c 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 07a17ae..c98fbbd 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();
 		}


Commit: 10abb0c646fee1ddf516330ab4736c6ab087569e
    https://github.com/scummvm/scummvm/commit/10abb0c646fee1ddf516330ab4736c6ab087569e
Author: Adrian Frühwirth (bonki at users.noreply.github.com)
Date: 2018-04-22T22:45:54+02:00

Commit Message:
TITANIC: Fix discrepancy between readSavegameHeader() declaration and definition

This should have been part of commit 00e59a3122.

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


diff --git a/engines/titanic/core/project_item.cpp b/engines/titanic/core/project_item.cpp
index 6da891c..17b506a 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) {
+WARN_UNUSED_RESULT bool CProjectItem::readSavegameHeader(SimpleFile *file, TitanicSavegameHeader &header, bool skipThumbnail) {
 	char saveIdentBuffer[SAVEGAME_STR_SIZE + 1];
 	header._thumbnail = nullptr;
 	header._totalFrames = 0;
diff --git a/engines/titanic/core/project_item.h b/engines/titanic/core/project_item.h
index ef557f7..1c5923f 100644
--- a/engines/titanic/core/project_item.h
+++ b/engines/titanic/core/project_item.h
@@ -155,7 +155,7 @@ public:
 	/**
 	 * Read in the header information for a savegame
 	 */
-	static bool readSavegameHeader(SimpleFile *file, TitanicSavegameHeader &header, bool loadThumbnail = false);
+	WARN_UNUSED_RESULT static bool readSavegameHeader(SimpleFile *file, TitanicSavegameHeader &header, bool skipThumbnail = true);
 public:
 	CLASSDEF;
 	CProjectItem();





More information about the Scummvm-git-logs mailing list