From fd32023437326dbebb52b4381d45f49fba78de13 Mon Sep 17 00:00:00 2001 From: Erik Hofman Date: Wed, 16 Jan 2019 14:55:37 +0100 Subject: [PATCH] Do not attempt to deregister the same emitter more than once --- simgear/sound/soundmgr_aeonwave.cxx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/simgear/sound/soundmgr_aeonwave.cxx b/simgear/sound/soundmgr_aeonwave.cxx index 93ee0997..111fa10e 100644 --- a/simgear/sound/soundmgr_aeonwave.cxx +++ b/simgear/sound/soundmgr_aeonwave.cxx @@ -418,7 +418,7 @@ void SGSoundMgr::release_source( unsigned int source ) { aax::Emitter& emitter = source_it->second; enum aaxState state = emitter.state(); - if (state == AAX_PLAYING || state == AAX_SUSPENDED) { + if (state != AAX_PROCESSED) { TRY( emitter.set(AAX_PROCESSED) ); TRY( d->_aax.remove(emitter) ); } @@ -590,7 +590,6 @@ void SGSoundMgr::sample_stop( SGSoundSample *sample ) #ifdef ENABLE_SOUND aax::Emitter& emitter = d->get_emitter(source); TRY( emitter.set(AAX_PROCESSED) ); - TRY( d->_aax.remove(emitter) ); #endif stopped = is_sample_stopped(sample); } @@ -610,7 +609,6 @@ void SGSoundMgr::sample_destroy( SGSoundSample *sample ) if ( sample->is_playing() ) { aax::Emitter& emitter = d->get_emitter(source); TRY( emitter.set(AAX_PROCESSED) ); - TRY( d->_aax.remove(emitter) ); } release_source( source ); #endif