]> git.mxchange.org Git - simgear.git/commitdiff
Alex Buzin:
authorehofman <ehofman>
Mon, 12 Oct 2009 17:22:41 +0000 (17:22 +0000)
committerTim Moore <timoore@redhat.com>
Tue, 13 Oct 2009 22:34:39 +0000 (00:34 +0200)
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

index d082d6c3cb132369ebf7c5101b465747314ef3db..11a10fde1c5ebecdc17680762299c7a5ac1aacac 100644 (file)
@@ -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);