aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Turner2011-01-21 23:43:02 +0000
committerDavid Turner2011-01-21 23:43:02 +0000
commitcb7eb365ae195f966be78e3ba472f19dcdd55d63 (patch)
tree48bd9361afd15073d80aa0d59b2752fe1a1367f4
parentf9422fb7260b8e5f0f45b93f22e0e4504a9e140b (diff)
downloadscummvm-rg350-cb7eb365ae195f966be78e3ba472f19dcdd55d63.tar.gz
scummvm-rg350-cb7eb365ae195f966be78e3ba472f19dcdd55d63.tar.bz2
scummvm-rg350-cb7eb365ae195f966be78e3ba472f19dcdd55d63.zip
TOON: Fix Memory Leak when opening Inventory.
svn-id: r55400
-rw-r--r--engines/toon/toon.cpp3
1 files changed, 3 insertions, 0 deletions
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);