]> git.mxchange.org Git - simgear.git/commitdiff
- stop sounds when removing a sound group
authorHarald JOHNSEN <hjohnsen@evc.net>
Sun, 10 Jun 2012 11:01:57 +0000 (13:01 +0200)
committerThorstenB <brehmt@gmail.com>
Tue, 19 Jun 2012 20:14:14 +0000 (22:14 +0200)
simgear/sound/sample_group.cxx

index 6b2d8566e3a8da6664916e32b4bd134f8969e400..2a0b67a76e50b4f112d25b6b1ebbf0060be935ce 100644 (file)
@@ -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;
 }