diff options
author | Erwin Coumans <blender@erwincoumans.com> | 2008-09-13 09:24:52 +0400 |
---|---|---|
committer | Erwin Coumans <blender@erwincoumans.com> | 2008-09-13 09:24:52 +0400 |
commit | 206cfe7955683ac166201e417977e933fd98f7b3 (patch) | |
tree | db9cfb63951b73d347a477e512a98942083f1446 /intern/SoundSystem | |
parent | 21d74deda6a26433ba36e5751ca74f0a162f3279 (diff) |
avoid crash when game engine returns to Blender, and OpenAL sources haven't been initialized properly for some reason.
Diffstat (limited to 'intern/SoundSystem')
-rw-r--r-- | intern/SoundSystem/openal/SND_OpenALDevice.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/intern/SoundSystem/openal/SND_OpenALDevice.cpp b/intern/SoundSystem/openal/SND_OpenALDevice.cpp index 82ed1c8a808..c660e9aecba 100644 --- a/intern/SoundSystem/openal/SND_OpenALDevice.cpp +++ b/intern/SoundSystem/openal/SND_OpenALDevice.cpp @@ -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; } |