From cb7eb365ae195f966be78e3ba472f19dcdd55d63 Mon Sep 17 00:00:00 2001 From: David Turner Date: Fri, 21 Jan 2011 23:43:02 +0000 Subject: TOON: Fix Memory Leak when opening Inventory. svn-id: r55400 --- engines/toon/toon.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'engines/toon/toon.cpp') diff --git a/engines/toon/toon.cpp b/engines/toon/toon.cpp index 80737f9358..a372208e45 100644 --- a/engines/toon/toon.cpp +++ b/engines/toon/toon.cpp @@ -741,6 +741,7 @@ ToonEngine::ToonEngine(OSystem *syst, const ADGameDescription *gameDescription) _system = syst; _tickLength = 16; _currentPicture = NULL; + _inventoryPicture = NULL; _currentMask = NULL; _showConversationText = true; _isDemo = _gameDescription->flags & ADGF_DEMO; @@ -828,6 +829,7 @@ ToonEngine::ToonEngine(OSystem *syst, const ADGameDescription *gameDescription) ToonEngine::~ToonEngine() { delete _currentPicture; delete _currentMask; + delete _inventoryPicture; delete _resources; delete _animationManager; @@ -2564,6 +2566,7 @@ int32 ToonEngine::showInventory() { int32 oldScrollValue = _gameState->_currentScrollValue; // Strangerke - Commented (not used) // Common::EventManager *_event = _system->getEventManager(); + delete _inventoryPicture; _inventoryPicture = new Picture(this); fadeOut(5); _inventoryPicture->loadPicture("SACK128.CPS", true); -- cgit v1.2.3