From 65b04e4b3d46809ae7085b9c6b3189fdef4a0c75 Mon Sep 17 00:00:00 2001 From: havoc Date: Tue, 31 Jan 2012 22:36:33 +0000 Subject: [PATCH] moved S_FreeSfx call in S_StopChannel to be in a safer place git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11665 d7cf8633-e32d-0410-b094-e92efae38249 --- snd_main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/snd_main.c b/snd_main.c index 614b1687..1fb7cd54 100644 --- a/snd_main.c +++ b/snd_main.c @@ -1765,17 +1765,17 @@ void S_StopChannel (unsigned int channel_ind, qboolean lockmutex, qboolean frees ch = &channels[channel_ind]; sfx = ch->sfx; - if (ch->sfx != NULL) + if (sfx != NULL) { if (sfx->fetcher != NULL && sfx->fetcher->stopchannel != NULL) sfx->fetcher->stopchannel(ch); ch->fetcher_data = NULL; ch->sfx = NULL; + if (freesfx) + S_FreeSfx(sfx, true); } if (lockmutex && !simsound) SndSys_UnlockRenderBuffer(); - if (freesfx) - S_FreeSfx(sfx, true); } -- 2.39.2