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:
@@ -232,6 +232,14 @@ _ReleaseSoundBankData (MEM_HANDLE Snd)
|
|||||||
sptr = (TFB_SoundSample **)((BYTE *)fxTab + fxTab->StringOffsets[0]);
|
sptr = (TFB_SoundSample **)((BYTE *)fxTab + fxTab->StringOffsets[0]);
|
||||||
while (snd_ct--)
|
while (snd_ct--)
|
||||||
{
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
for (i = 0; i < NUM_SOUNDSOURCES; ++i)
|
||||||
|
{
|
||||||
|
if (soundSource[i].sample == (*sptr))
|
||||||
|
soundSource[i].sample = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if ((*sptr)->decoder)
|
if ((*sptr)->decoder)
|
||||||
SoundDecoder_Free ((*sptr)->decoder);
|
SoundDecoder_Free ((*sptr)->decoder);
|
||||||
alDeleteBuffers ((*sptr)->num_buffers, (*sptr)->buffer);
|
alDeleteBuffers ((*sptr)->num_buffers, (*sptr)->buffer);
|
||||||
|
|||||||
Reference in New Issue
Block a user