From: havoc Date: Tue, 31 Jan 2012 22:36:33 +0000 (+0000) Subject: moved S_FreeSfx call in S_StopChannel to be in a safer place X-Git-Tag: xonotic-v0.6.0~43 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=5864d6ddf200fbf11dffe1f36539c196c6641010;p=xonotic%2Fdarkplaces.git 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 ::stable-branch::merge=65b04e4b3d46809ae7085b9c6b3189fdef4a0c75 --- 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); }