avoid crash when game engine returns to Blender, and OpenAL sources haven't been...
authorErwin Coumans <blender@erwincoumans.com>
Sat, 13 Sep 2008 05:24:52 +0000 (05:24 +0000)
committerErwin Coumans <blender@erwincoumans.com>
Sat, 13 Sep 2008 05:24:52 +0000 (05:24 +0000)
intern/SoundSystem/openal/SND_OpenALDevice.cpp

index 82ed1c8a808d3bc4c6ed0878edb5ddb2bc97323f..c660e9aecba49c278ae4a7ed93dd33eca13908bf 100644 (file)
@@ -294,6 +294,10 @@ SND_OpenALDevice::SND_OpenALDevice()
                // let openal generate its sources
                if (alc_error == ALC_NO_ERROR)
                {
+                       int i;
+
+                       for (i=0;i<NUM_SOURCES;i++)
+                               m_sources[i] = 0;
                        alGenSources(NUM_SOURCES, m_sources);
                        m_sourcesinitialized = true;
                }