diff --git a/simgear/sound/sample_group.cxx b/simgear/sound/sample_group.cxx index ac04d99e..cc594c2f 100644 --- a/simgear/sound/sample_group.cxx +++ b/simgear/sound/sample_group.cxx @@ -113,6 +113,8 @@ void SGSampleGroup::update( double dt ) { sample->stop(); if ( !sample->is_queue() ) { ALuint buffer = sample->get_buffer(); + // disconnect buffer from its source - otherwise it cannot be deleted + alSourceUnqueueBuffers(sample->get_source(), 1, &buffer); alDeleteBuffers( 1, &buffer ); testForALError("buffer remove"); } diff --git a/simgear/sound/sample_group.hxx b/simgear/sound/sample_group.hxx index ccf1e85d..56f1bd45 100644 --- a/simgear/sound/sample_group.hxx +++ b/simgear/sound/sample_group.hxx @@ -180,7 +180,7 @@ public: /** * Request to stop playing the refered audio sample. * @param refname Reference name of the audio sample to stop - * @return true if the audio sample exsists and is scheduled to stop + * @return true if the audio sample exists and is scheduled to stop */ bool stop( const string& refname );