From: ehofman Date: Mon, 12 Oct 2009 17:22:41 +0000 (+0000) Subject: Alex Buzin: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=f16199283644236bd33eed77dc622a3ce70a995f;p=simgear.git 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(); --- 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);