aboutsummaryrefslogtreecommitdiff
path: root/scumm
diff options
context:
space:
mode:
authorTravis Howell2006-01-27 06:05:03 +0000
committerTravis Howell2006-01-27 06:05:03 +0000
commit548961ecc35374da59d5d5f5397c6c5159026e12 (patch)
tree0d5c0f957da60915f1e0aa9bc86a2df3f7c42363 /scumm
parent58dcb8436fc6498e6886ee9d65f57feda8db8148 (diff)
downloadscummvm-rg350-548961ecc35374da59d5d5f5397c6c5159026e12.tar.gz
scummvm-rg350-548961ecc35374da59d5d5f5397c6c5159026e12.tar.bz2
scummvm-rg350-548961ecc35374da59d5d5f5397c6c5159026e12.zip
A
Fix memory leaks in HE games on exit. svn-id: r20208
Diffstat (limited to 'scumm')
-rw-r--r--scumm/scumm.cpp3
-rw-r--r--scumm/sound.cpp3
-rw-r--r--scumm/sprite_he.cpp6
-rw-r--r--scumm/sprite_he.h1
4 files changed, 13 insertions, 0 deletions
diff --git a/scumm/scumm.cpp b/scumm/scumm.cpp
index 973bb03615..89275cf53e 100644
--- a/scumm/scumm.cpp
+++ b/scumm/scumm.cpp
@@ -1670,6 +1670,9 @@ ScummEngine_v90he::~ScummEngine_v90he() {
if (_heversion >= 98) {
delete _logicHE;
}
+ if (_heversion >= 99) {
+ free(_hePalettes);
+ }
}
#endif
diff --git a/scumm/sound.cpp b/scumm/sound.cpp
index df45982ec5..bcccb6c6c6 100644
--- a/scumm/sound.cpp
+++ b/scumm/sound.cpp
@@ -88,6 +88,9 @@ Sound::Sound(ScummEngine *parent)
Sound::~Sound() {
stopCDTimer();
delete _sfxFile;
+
+ // HE Specific
+ free(_heMusic);
}
void Sound::addSoundToQueue(int sound, int heOffset, int heChannel, int heFlags) {
diff --git a/scumm/sprite_he.cpp b/scumm/sprite_he.cpp
index 923c7556c4..2057c34b35 100644
--- a/scumm/sprite_he.cpp
+++ b/scumm/sprite_he.cpp
@@ -36,6 +36,12 @@ namespace Scumm {
Sprite::Sprite(ScummEngine_v90he *vm) : _vm(vm) {
}
+Sprite::~Sprite() {
+ free(_spriteGroups);
+ free(_spriteTable);
+ free(_activeSpritesTable);
+}
+
void ScummEngine_v90he::allocateArrays() {
ScummEngine::allocateArrays();
_sprite->allocTables(_numSprites, MAX(64, _numSprites / 4), 64);
diff --git a/scumm/sprite_he.h b/scumm/sprite_he.h
index 848c3604b4..6cc1db7562 100644
--- a/scumm/sprite_he.h
+++ b/scumm/sprite_he.h
@@ -102,6 +102,7 @@ class ScummEngine_v90he;
class Sprite {
public:
Sprite(ScummEngine_v90he *vm);
+ virtual ~Sprite();
SpriteInfo *_spriteTable;
SpriteGroup *_spriteGroups;