aboutsummaryrefslogtreecommitdiff
path: root/engines/saga/saga.cpp
diff options
context:
space:
mode:
authorChristopher Page2008-06-12 16:58:02 +0000
committerChristopher Page2008-06-12 16:58:02 +0000
commitdd423f803b43a0e6c54c3d7441c40cb7737d7867 (patch)
treef79e245bb934ac6b6915b3412d7863230014d43a /engines/saga/saga.cpp
parente86a422e252ade394ca796cae767c4d3221d3c4a (diff)
downloadscummvm-rg350-dd423f803b43a0e6c54c3d7441c40cb7737d7867.tar.gz
scummvm-rg350-dd423f803b43a0e6c54c3d7441c40cb7737d7867.tar.bz2
scummvm-rg350-dd423f803b43a0e6c54c3d7441c40cb7737d7867.zip
SAGA: Fixed memory leaks in the SAGA engine
svn-id: r32673
Diffstat (limited to 'engines/saga/saga.cpp')
-rw-r--r--engines/saga/saga.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/engines/saga/saga.cpp b/engines/saga/saga.cpp
index 40eb32b276..fafbd02cec 100644
--- a/engines/saga/saga.cpp
+++ b/engines/saga/saga.cpp
@@ -79,6 +79,7 @@ SagaEngine::SagaEngine(OSystem *syst, const SAGAGameDescription *gameDesc)
_scene = NULL;
_isoMap = NULL;
_gfx = NULL;
+ _driver = NULL;
_console = NULL;
_render = NULL;
_music = NULL;
@@ -133,6 +134,7 @@ SagaEngine::~SagaEngine() {
delete _render;
delete _music;
delete _sound;
+ delete _driver;
delete _gfx;
delete _console;
@@ -188,11 +190,11 @@ int SagaEngine::init() {
bool native_mt32 = ((midiDriver == MD_MT32) || ConfMan.getBool("native_mt32"));
bool adlib = (midiDriver == MD_ADLIB);
- MidiDriver *driver = MidiDriver::createMidi(midiDriver);
+ _driver = MidiDriver::createMidi(midiDriver);
if (native_mt32)
- driver->property(MidiDriver::PROP_CHANNEL_MASK, 0x03FE);
+ _driver->property(MidiDriver::PROP_CHANNEL_MASK, 0x03FE);
- _music = new Music(this, _mixer, driver, _musicVolume);
+ _music = new Music(this, _mixer, _driver, _musicVolume);
_music->setNativeMT32(native_mt32);
_music->setAdlib(adlib);