diff --git a/neo/sound/snd_emitter.cpp b/neo/sound/snd_emitter.cpp index 08c6fa38..495da4d1 100644 --- a/neo/sound/snd_emitter.cpp +++ b/neo/sound/snd_emitter.cpp @@ -227,6 +227,9 @@ void idSoundChannel::ALStop( void ) { if ( alIsSource( openalSource ) ) { alSourceStop( openalSource ); alSourcei( openalSource, AL_BUFFER, 0 ); + // unassociate effect slot from source, so the effect slot can be deleted on shutdown + // even though the source itself is deleted later (in idSoundSystemLocal::Shutdown()) + alSource3i( openalSource, AL_AUXILIARY_SEND_FILTER, AL_EFFECTSLOT_NULL, 0, AL_FILTER_NULL ); soundSystemLocal.FreeOpenALSource( openalSource ); } diff --git a/neo/sound/snd_world.cpp b/neo/sound/snd_world.cpp index 5247701e..20270c27 100644 --- a/neo/sound/snd_world.cpp +++ b/neo/sound/snd_world.cpp @@ -157,6 +157,15 @@ void idSoundWorldLocal::Shutdown() { AVIClose(); + // delete emitters before deletign the listenerSlot, so their sources aren't + // associated with the listenerSlot anymore + for ( i = 0; i < emitters.Num(); i++ ) { + if ( emitters[i] ) { + delete emitters[i]; + emitters[i] = NULL; + } + } + if (idSoundSystemLocal::useEFXReverb) { if (soundSystemLocal.alIsAuxiliaryEffectSlot(listenerSlot)) { soundSystemLocal.alAuxiliaryEffectSloti(listenerSlot, AL_EFFECTSLOT_EFFECT, AL_EFFECTSLOT_NULL); @@ -175,12 +184,6 @@ void idSoundWorldLocal::Shutdown() { } } - for ( i = 0; i < emitters.Num(); i++ ) { - if ( emitters[i] ) { - delete emitters[i]; - emitters[i] = NULL; - } - } localSound = NULL; }