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

dreammaster dreammaster at scummvm.org
Tue Sep 19 03:00:45 CEST 2017


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:
f6ef3cbc9e TITANIC: Fix memory leak on thumbnails when loading savegames


Commit: f6ef3cbc9e6873417af71ce9cf0b841b6e85e9d0
    https://github.com/scummvm/scummvm/commit/f6ef3cbc9e6873417af71ce9cf0b841b6e85e9d0
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-09-18T21:00:39-04:00

Commit Message:
TITANIC: Fix memory leak on thumbnails when loading savegames

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


diff --git a/engines/titanic/core/project_item.cpp b/engines/titanic/core/project_item.cpp
index 94689f1..16fe0e6 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





More information about the Scummvm-git-logs mailing list