From 3bc7921a99b73a8faf9ce40802bc0837dd32b658 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Tue, 27 Mar 2007 00:50:08 +0000 Subject: [PATCH] plug a potential channel leak --- libs/audio/renderer/snd_channels.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libs/audio/renderer/snd_channels.c b/libs/audio/renderer/snd_channels.c index 5482634dc..d45ed0eca 100644 --- a/libs/audio/renderer/snd_channels.c +++ b/libs/audio/renderer/snd_channels.c @@ -600,8 +600,10 @@ SND_StartSound (int entnum, int entchannel, sfx_t *sfx, const vec3_t origin, for (check = looped_dynamic_channels; check; check = check->next) if (snd_check_channels (target_chan, check, osfx)) break; - if (!osfx->retain (osfx)) + if (!osfx->retain (osfx)) { + SND_ChannelStop (target_chan); return; // couldn't load the sound's data + } target_chan->sfx = osfx; }