aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorTravis Howell2007-06-07 02:51:09 +0000
committerTravis Howell2007-06-07 02:51:09 +0000
commita18357580ba33029251ad96bf2d3fea775ca22ed (patch)
treebe8328b6c1cd487fbfa168b597c1342acf481ce7 /engines
parentf0acfc0a28530c00eb285389e37428347a1ad57f (diff)
downloadscummvm-rg350-a18357580ba33029251ad96bf2d3fea775ca22ed.tar.gz
scummvm-rg350-a18357580ba33029251ad96bf2d3fea775ca22ed.tar.bz2
scummvm-rg350-a18357580ba33029251ad96bf2d3fea775ca22ed.zip
Fix memory leaks on when quiting game.
svn-id: r27160
Diffstat (limited to 'engines')
-rw-r--r--engines/agos/agos.cpp36
1 files changed, 31 insertions, 5 deletions
diff --git a/engines/agos/agos.cpp b/engines/agos/agos.cpp
index c9f4b6cb2c..afd120354c 100644
--- a/engines/agos/agos.cpp
+++ b/engines/agos/agos.cpp
@@ -901,6 +901,7 @@ void AGOSEngine::setupGame() {
}
AGOSEngine::~AGOSEngine() {
+ // Sync with AGOSEngine::shutdown()
delete _gameFile;
_midi.close();
@@ -1033,18 +1034,43 @@ int AGOSEngine::go() {
}
void AGOSEngine::shutdown() {
+ // Sync with AGOSEngine::~AGOSEngine()
delete _gameFile;
_midi.close();
- free(_stringTabPtr);
- free(_itemArrayPtr);
free(_itemHeapPtr - _itemHeapCurPos);
free(_tablesHeapPtr - _tablesHeapCurPos);
- free(_tblList);
- free(_zoneBuffers);
- free(_iconFilePtr);
+
free(_gameOffsetsPtr);
+ free(_iconFilePtr);
+ free(_itemArrayPtr);
+ free(_stringTabPtr);
+ free(_strippedTxtMem);
+ free(_tblList);
+ free(_textMem);
+
+ free(_backGroundBuf);
+ free(_frontBuf);
+ free(_backBuf);
+ free(_scaleBuf);
+
+ free(_window4BackScn);
+ free(_window6BackScn);
+
+ free(_variableArray);
+ free(_variableArray2);
+
+ delete _dummyItem1;
+ delete _dummyItem2;
+ delete _dummyItem3;
+
+ delete [] _dummyWindow;
+ delete [] _windowList;
+
+ delete _debugger;
+ delete _moviePlay;
+ delete _sound;
_system->quit();
}