From f16199283644236bd33eed77dc622a3ce70a995f Mon Sep 17 00:00:00 2001 From: ehofman Date: Mon, 12 Oct 2009 17:22:41 +0000 Subject: [PATCH] Alex Buzin: I got an error with the Sunday CVS - FG crashed while exiting . gdb reports SIGSEGV error at file soundmgr_openal.cxx, line 159. Error was fixed by changing lines 157-159 from: buffer_map_iterator buffers_current = _buffers.begin(); buffer_map_iterator buffers_end = _buffers.end(); for ( ; buffers_current != buffers_end; ++buffers_current ) { to : buffer_map_iterator buffers_current; while(_buffers.size()){ buffers_current = _buffers.begin(); --- simgear/sound/soundmgr_openal.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/simgear/sound/soundmgr_openal.cxx b/simgear/sound/soundmgr_openal.cxx index d082d6c3..11a10fde 100644 --- a/simgear/sound/soundmgr_openal.cxx +++ b/simgear/sound/soundmgr_openal.cxx @@ -154,9 +154,9 @@ void SGSoundMgr::stop() { _working = false; // clear any OpenAL buffers before shutting down - buffer_map_iterator buffers_current = _buffers.begin(); - buffer_map_iterator buffers_end = _buffers.end(); - for ( ; buffers_current != buffers_end; ++buffers_current ) { + buffer_map_iterator buffers_current; + while(_buffers.size()){ + buffers_current = _buffers.begin(); refUint ref = buffers_current->second; ALuint buffer = ref.id; alDeleteBuffers(1, &buffer); -- 2.39.5