Fixed an unsafe memory freeing

git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@384 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
gewlitys
2002-12-09 19:26:42 +00:00
parent 864e86dc09
commit 24cb2c8474
+8
View File
@@ -232,6 +232,14 @@ _ReleaseSoundBankData (MEM_HANDLE Snd)
sptr = (TFB_SoundSample **)((BYTE *)fxTab + fxTab->StringOffsets[0]);
while (snd_ct--)
{
int i;
for (i = 0; i < NUM_SOUNDSOURCES; ++i)
{
if (soundSource[i].sample == (*sptr))
soundSource[i].sample = NULL;
}
if ((*sptr)->decoder)
SoundDecoder_Free ((*sptr)->decoder);
alDeleteBuffers ((*sptr)->num_buffers, (*sptr)->buffer);