aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTravis Howell2006-01-27 08:39:29 +0000
committerTravis Howell2006-01-27 08:39:29 +0000
commit4d8861b909d0b4677afe450cb76b83842d37f679 (patch)
tree50ecaea0d0eaa62e63ab82cfc0016e8e88cd44a5
parent64dc91359636e14f647e79003b44e7701b5c8af1 (diff)
downloadscummvm-rg350-4d8861b909d0b4677afe450cb76b83842d37f679.tar.gz
scummvm-rg350-4d8861b909d0b4677afe450cb76b83842d37f679.tar.bz2
scummvm-rg350-4d8861b909d0b4677afe450cb76b83842d37f679.zip
Fix memory leak on exit.
svn-id: r20212
-rw-r--r--scumm/imuse_digi/dimuse_bndmgr.cpp5
-rw-r--r--scumm/imuse_digi/dimuse_sndmgr.cpp2
-rw-r--r--scumm/sound.cpp1
-rw-r--r--scumm/sound_he.cpp2
4 files changed, 7 insertions, 3 deletions
diff --git a/scumm/imuse_digi/dimuse_bndmgr.cpp b/scumm/imuse_digi/dimuse_bndmgr.cpp
index 1da812bc9f..f603256e2a 100644
--- a/scumm/imuse_digi/dimuse_bndmgr.cpp
+++ b/scumm/imuse_digi/dimuse_bndmgr.cpp
@@ -32,13 +32,14 @@ BundleDirCache::BundleDirCache() {
_budleDirCache[fileId].fileName[0] = 0;
_budleDirCache[fileId].numFiles = 0;
_budleDirCache[fileId].compressedBun = false;
+ _budleDirCache[fileId].indexTable = NULL;
}
}
BundleDirCache::~BundleDirCache() {
for (int fileId = 0; fileId < ARRAYSIZE(_budleDirCache); fileId++) {
- if (_budleDirCache[fileId].bundleTable != NULL)
- free (_budleDirCache[fileId].bundleTable);
+ free(_budleDirCache[fileId].bundleTable);
+ free(_budleDirCache[fileId].indexTable);
}
}
diff --git a/scumm/imuse_digi/dimuse_sndmgr.cpp b/scumm/imuse_digi/dimuse_sndmgr.cpp
index 935b12ddb8..485f27a9c3 100644
--- a/scumm/imuse_digi/dimuse_sndmgr.cpp
+++ b/scumm/imuse_digi/dimuse_sndmgr.cpp
@@ -48,6 +48,8 @@ ImuseDigiSndMgr::~ImuseDigiSndMgr() {
for (int l = 0; l < MAX_IMUSE_SOUNDS; l++) {
closeSound(&_sounds[l]);
}
+
+ delete _cacheBundleDir;
}
void ImuseDigiSndMgr::countElements(byte *ptr, int &numRegions, int &numJumps, int &numSyncs) {
diff --git a/scumm/sound.cpp b/scumm/sound.cpp
index bcccb6c6c6..588e204c7a 100644
--- a/scumm/sound.cpp
+++ b/scumm/sound.cpp
@@ -77,6 +77,7 @@ Sound::Sound(ScummEngine *parent)
_currentMusic(0),
_soundsPaused(false),
_sfxMode(0),
+ _heMusic(0),
_heMusicTracks(0) {
memset(_heChannel, 0, sizeof(_heChannel));
diff --git a/scumm/sound_he.cpp b/scumm/sound_he.cpp
index 1dc1f66ebf..f654eeff95 100644
--- a/scumm/sound_he.cpp
+++ b/scumm/sound_he.cpp
@@ -404,7 +404,7 @@ void Sound::playHESound(int soundID, int heOffset, int heChannel, int heFlags) {
sound = (char *)malloc(size * 4);
size = voxStream->readBuffer((int16*)sound, size * 2);
size *= 2; // 16bits.
- delete(voxStream);
+ delete voxStream;
} else {
// Allocate a sound buffer, copy the data into it, and play
sound = (char *)malloc(size);