Skip to content

Commit

Permalink
AGI: Fix sound deinit. CID 1004128
Browse files Browse the repository at this point in the history
We really left sound gen leaked with preagi games.
  • Loading branch information
sev- committed Apr 21, 2013
1 parent 5d7067b commit 4a17b91
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 18 deletions.
6 changes: 1 addition & 5 deletions engines/agi/agi.cpp
Expand Up @@ -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() {
Expand Down Expand Up @@ -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;

Expand Down
1 change: 0 additions & 1 deletion engines/agi/preagi_winnie.cpp
Expand Up @@ -1334,7 +1334,6 @@ void WinnieEngine::init() {
}

_sound = new SoundMgr(this, _mixer);
_sound->initSound();
setflag(fSoundOn, true); // enable sound

memset(&_gameStateWinnie, 0, sizeof(_gameStateWinnie));
Expand Down
13 changes: 3 additions & 10 deletions engines/agi/sound.cpp
Expand Up @@ -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);
Expand Down Expand Up @@ -219,6 +209,9 @@ void SoundMgr::setVolume(uint8 volume) {
}

SoundMgr::~SoundMgr() {
stopSound();

delete _soundGen;
}

} // End of namespace Agi
2 changes: 0 additions & 2 deletions engines/agi/sound.h
Expand Up @@ -139,8 +139,6 @@ class SoundMgr {

void unloadSound(int);
void playSound();
int initSound();
void deinitSound();
void startSound(int, int);
void stopSound();

Expand Down

0 comments on commit 4a17b91

Please sign in to comment.