AGI: Fix sound deinit. CID 1004128

We really left sound gen leaked with preagi games.
This commit is contained in:
Eugene Sandulenko 2013-04-21 14:12:13 +03:00
parent 5d7067baaa
commit 4a17b91db2
4 changed files with 4 additions and 18 deletions

View File

@ -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;

View File

@ -1334,7 +1334,6 @@ void WinnieEngine::init() {
}
_sound = new SoundMgr(this, _mixer);
_sound->initSound();
setflag(fSoundOn, true); // enable sound
memset(&_gameStateWinnie, 0, sizeof(_gameStateWinnie));

View File

@ -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

View File

@ -139,8 +139,6 @@ public:
void unloadSound(int);
void playSound();
int initSound();
void deinitSound();
void startSound(int, int);
void stopSound();