From 5b3dccc1f74d5a0efaa9a98c6879c349dfb14127 Mon Sep 17 00:00:00 2001 From: Harald JOHNSEN Date: Sun, 10 Jun 2012 13:01:57 +0200 Subject: [PATCH] - stop sounds when removing a sound group --- simgear/sound/sample_group.cxx | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/simgear/sound/sample_group.cxx b/simgear/sound/sample_group.cxx index 6b2d8566..2a0b67a7 100644 --- a/simgear/sound/sample_group.cxx +++ b/simgear/sound/sample_group.cxx @@ -66,17 +66,7 @@ SGSampleGroup::~SGSampleGroup () { _active = false; - sample_map_iterator sample_current = _samples.begin(); - sample_map_iterator sample_end = _samples.end(); - for ( ; sample_current != sample_end; ++sample_current ) { - SGSoundSample *sample = sample_current->second; - - if ( sample->is_valid_source() && sample->is_playing() ) { - sample->no_valid_source(); - _smgr->release_source( sample->get_source() ); - _smgr->release_buffer( sample ); - } - } + this->stop(); _smgr = 0; } -- 2.39.5