From ae714dc076def8efb6448c1d39058fbabb0e096f Mon Sep 17 00:00:00 2001 From: Einar Johan Trøan Sømåen Date: Wed, 27 Jun 2012 22:03:15 +0200 Subject: WINTERMUTE: Fix a memory leak. --- engines/wintermute/Base/BImage.cpp | 3 +++ engines/wintermute/Base/BPersistMgr.cpp | 1 + 2 files changed, 4 insertions(+) (limited to 'engines/wintermute') diff --git a/engines/wintermute/Base/BImage.cpp b/engines/wintermute/Base/BImage.cpp index cbe134c7c6..95f6f5bbbf 100644 --- a/engines/wintermute/Base/BImage.cpp +++ b/engines/wintermute/Base/BImage.cpp @@ -61,6 +61,9 @@ CBImage::CBImage(CBGame *inGame, FIBITMAP *bitmap): CBBase(inGame) { CBImage::~CBImage() { /* delete _bitmap; */ delete _decoder; + if (_deletableSurface) { + _deletableSurface->free(); + } delete _deletableSurface; #if 0 if (_bitmap) FreeImage_Unload(_bitmap); diff --git a/engines/wintermute/Base/BPersistMgr.cpp b/engines/wintermute/Base/BPersistMgr.cpp index 5a70fd3729..8b037db926 100644 --- a/engines/wintermute/Base/BPersistMgr.cpp +++ b/engines/wintermute/Base/BPersistMgr.cpp @@ -93,6 +93,7 @@ void CBPersistMgr::cleanup() { _richBuffer = NULL; _richBufferSize = 0; + delete[] _savedDescription; _savedDescription = NULL; // ref to buffer // _savedTimestamp = 0; _savedVerMajor = _savedVerMinor = _savedVerBuild = 0; -- cgit v1.2.3