From e17b3a753e57e4141eb4d30f7122640cb021b98c Mon Sep 17 00:00:00 2001 From: ThorstenB Date: Sun, 4 Dec 2011 20:16:36 +0100 Subject: [PATCH] sound: fix "source" resource leak Sound resources were eaten up when a sample could not be loaded. Restores sound for aircraft attempting to use stereo files for sound effects. However, when loading fails, sound code still tries to load the same file again and again (always resulting in the same "stereo files not supported" error), which slows down simulation. --- simgear/sound/sample_group.cxx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/simgear/sound/sample_group.cxx b/simgear/sound/sample_group.cxx index 1af1f268..ac04d99e 100644 --- a/simgear/sound/sample_group.cxx +++ b/simgear/sound/sample_group.cxx @@ -156,7 +156,10 @@ void SGSampleGroup::update( double dt ) { else { if (_smgr->request_buffer(sample) == SGSoundMgr::NO_BUFFER) + { + _smgr->release_source(source); continue; + } // start playing the sample ALuint buffer = sample->get_buffer(); -- 2.39.5