diff options
author | Eugene Sandulenko | 2013-04-21 14:12:13 +0300 |
---|---|---|
committer | Eugene Sandulenko | 2013-04-21 14:12:13 +0300 |
commit | 4a17b91db2660848e6d2e8d41b383bebbe11f472 (patch) | |
tree | 7588bfb8bae9f7e07ec122455c647d42656ea3d9 /engines/agi | |
parent | 5d7067baaa5aef82b7584403c8f1fa256d9bbb9b (diff) | |
download | scummvm-rg350-4a17b91db2660848e6d2e8d41b383bebbe11f472.tar.gz scummvm-rg350-4a17b91db2660848e6d2e8d41b383bebbe11f472.tar.bz2 scummvm-rg350-4a17b91db2660848e6d2e8d41b383bebbe11f472.zip |
AGI: Fix sound deinit. CID 1004128
We really left sound gen leaked with preagi games.
Diffstat (limited to 'engines/agi')
-rw-r--r-- | engines/agi/agi.cpp | 6 | ||||
-rw-r--r-- | engines/agi/preagi_winnie.cpp | 1 | ||||
-rw-r--r-- | engines/agi/sound.cpp | 13 | ||||
-rw-r--r-- | engines/agi/sound.h | 2 |
4 files changed, 4 insertions, 18 deletions
diff --git a/engines/agi/agi.cpp b/engines/agi/agi.cpp index 98ffca22ed..f79dfa35c2 100644 --- a/engines/agi/agi.cpp +++ b/engines/agi/agi.cpp @@ -513,10 +513,7 @@ AgiBase::AgiBase(OSystem *syst, const AGIGameDescription *gameDesc) : Engine(sys AgiBase::~AgiBase() { delete _rnd; - if (_sound) { - _sound->deinitSound(); - delete _sound; - } + delete _sound; } void AgiBase::initRenderMode() { @@ -650,7 +647,6 @@ void AgiEngine::initialize() { _game.sbuf = _game.sbuf16c; // Make sbuf point to the 16 color (+control line & priority info) AGI screen by default _gfx->initVideo(); - _sound->initSound(); _lastSaveTime = 0; diff --git a/engines/agi/preagi_winnie.cpp b/engines/agi/preagi_winnie.cpp index 37f8661367..06a6988bc5 100644 --- a/engines/agi/preagi_winnie.cpp +++ b/engines/agi/preagi_winnie.cpp @@ -1334,7 +1334,6 @@ void WinnieEngine::init() { } _sound = new SoundMgr(this, _mixer); - _sound->initSound(); setflag(fSoundOn, true); // enable sound memset(&_gameStateWinnie, 0, sizeof(_gameStateWinnie)); diff --git a/engines/agi/sound.cpp b/engines/agi/sound.cpp index 3ae4d548dc..56c7ebcb0b 100644 --- a/engines/agi/sound.cpp +++ b/engines/agi/sound.cpp @@ -167,16 +167,6 @@ void SoundMgr::stopSound() { _endflag = -1; } -int SoundMgr::initSound() { - return -1; -} - -void SoundMgr::deinitSound() { - stopSound(); - - delete _soundGen; -} - void SoundMgr::soundIsFinished() { if (_endflag != -1) _vm->setflag(_endflag, true); @@ -219,6 +209,9 @@ void SoundMgr::setVolume(uint8 volume) { } SoundMgr::~SoundMgr() { + stopSound(); + + delete _soundGen; } } // End of namespace Agi diff --git a/engines/agi/sound.h b/engines/agi/sound.h index 528becbb58..f300af83a3 100644 --- a/engines/agi/sound.h +++ b/engines/agi/sound.h @@ -139,8 +139,6 @@ public: void unloadSound(int); void playSound(); - int initSound(); - void deinitSound(); void startSound(int, int); void stopSound(); |