SAGA: Fix memory leak in Mac version of IHNM

CID 1004123. Unfortunately, I do not have this version of the game
so I cannot verify that this fix is correct, but it should be.
This commit is contained in:
Torbjörn Andersson 2013-04-27 06:38:48 +02:00
parent 81f5a89093
commit b77a516414
2 changed files with 10 additions and 0 deletions

View File

@ -104,6 +104,15 @@ SndRes::SndRes(SagaEngine *vm) : _vm(vm), _sfxContext(NULL), _voiceContext(NULL)
}
}
SndRes::~SndRes() {
#ifdef ENABLE_IHNM
if (_vm->getGameId() == GID_IHNM && _vm->isMacResources()) {
// Delete the dummy voice context. See setVoiceBank()
delete _voiceContext;
}
#endif
}
void SndRes::setVoiceBank(int serial) {
Common::File *file;
if (_voiceSerial == serial)

View File

@ -39,6 +39,7 @@ class SndRes {
public:
SndRes(SagaEngine *vm);
~SndRes();
void playSound(uint32 resourceId, int volume, bool loop);
void playVoice(uint32 resourceId);