Skip to content

Commit

Permalink
HOPKINS: Bugfix for crash when pushing button in purgatory control room
Browse files Browse the repository at this point in the history
  • Loading branch information
dreammaster committed Nov 17, 2012
1 parent 3da8683 commit 832f06f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions engines/hopkins/sound.cpp
Expand Up @@ -625,7 +625,7 @@ void SoundManager::PLAY_WAV(int wavIndex) {
int SoundManager::VOICE_STAT(int voiceIndex) {
if (Voice[voiceIndex]._status) {
int wavIndex = Voice[voiceIndex]._wavIndex;
if (Swav[wavIndex]._audioStream->endOfStream())
if (Swav[wavIndex]._audioStream != NULL && Swav[wavIndex]._audioStream->endOfStream())
STOP_VOICE(voiceIndex);
}

Expand Down Expand Up @@ -670,10 +670,11 @@ void SoundManager::PLAY_VOICE_SDL() {

bool SoundManager::DEL_SAMPLE_SDL(int wavIndex) {
if (Swav[wavIndex]._active) {
Swav[wavIndex]._active = false;

_vm->_mixer->stopHandle(Swav[wavIndex]._soundHandle);
delete Swav[wavIndex]._audioStream;
Swav[wavIndex]._audioStream = NULL;
Swav[wavIndex]._active = false;

return true;
} else {
return false;
Expand Down

0 comments on commit 832f06f

Please sign in to comment.