From f6ef3cbc9e6873417af71ce9cf0b841b6e85e9d0 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Mon, 18 Sep 2017 21:00:39 -0400 Subject: TITANIC: Fix memory leak on thumbnails when loading savegames --- engines/titanic/core/project_item.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'engines/titanic/core/project_item.cpp') diff --git a/engines/titanic/core/project_item.cpp b/engines/titanic/core/project_item.cpp index 94689f1600..16fe0e6ec1 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 -- cgit v1.2.3