diff options
author | Christopher Page | 2008-08-13 21:37:02 +0000 |
---|---|---|
committer | Christopher Page | 2008-08-13 21:37:02 +0000 |
commit | 4f00562bb2a0343259caa8d276e351ed8f94baf2 (patch) | |
tree | 950de252ea18266191ae1cc22cac9259d3a6e043 | |
parent | 8d8c46e36fade04d4452f0ce1fbdd3ee942ac898 (diff) | |
download | scummvm-rg350-4f00562bb2a0343259caa8d276e351ed8f94baf2.tar.gz scummvm-rg350-4f00562bb2a0343259caa8d276e351ed8f94baf2.tar.bz2 scummvm-rg350-4f00562bb2a0343259caa8d276e351ed8f94baf2.zip |
Fixed some memory leaks in Tinsel
svn-id: r33849
-rw-r--r-- | engines/tinsel/tinsel.cpp | 8 | ||||
-rw-r--r-- | engines/tinsel/tinsel.h | 1 |
2 files changed, 6 insertions, 3 deletions
diff --git a/engines/tinsel/tinsel.cpp b/engines/tinsel/tinsel.cpp index 16e477c947..c91fecf84e 100644 --- a/engines/tinsel/tinsel.cpp +++ b/engines/tinsel/tinsel.cpp @@ -622,11 +622,11 @@ TinselEngine::TinselEngine(OSystem *syst, const TinselGameDescription *gameDesc) 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 MusicPlayer(driver); + _music = new MusicPlayer(_driver); //_music->setNativeMT32(native_mt32); //_music->setAdlib(adlib); @@ -644,6 +644,8 @@ TinselEngine::~TinselEngine() { delete _sound; delete _music; delete _console; + delete _driver; + _screenSurface.free(); FreeSs(); FreeTextBuffer(); FreeHandleTable(); diff --git a/engines/tinsel/tinsel.h b/engines/tinsel/tinsel.h index 3d0ace19be..347a344519 100644 --- a/engines/tinsel/tinsel.h +++ b/engines/tinsel/tinsel.h @@ -101,6 +101,7 @@ public: uint16 getVersion() const; Common::Platform getPlatform() const; + MidiDriver *_driver; SoundManager *_sound; MusicPlayer *_music; |