From 194c9aa097bd9a7209eb4aff1a98e9ba1ad15d2e Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Mon, 21 Apr 2003 01:39:07 +0000 Subject: [PATCH] fix the file handle leak --- libs/audio/renderer/snd_dma.c | 4 ++-- libs/audio/renderer/vorbis.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/audio/renderer/snd_dma.c b/libs/audio/renderer/snd_dma.c index 04453c80f..835718765 100644 --- a/libs/audio/renderer/snd_dma.c +++ b/libs/audio/renderer/snd_dma.c @@ -526,8 +526,8 @@ SND_UpdateAmbientSounds (void) if (!ambient_sfx[ambient_channel]) { chan->sfx = 0; continue; - } - chan->sfx = ambient_sfx[ambient_channel]->open (ambient_sfx[ambient_channel]); + } else if (!chan->sfx) + chan->sfx = ambient_sfx[ambient_channel]->open (ambient_sfx[ambient_channel]); vol = ambient_level->value * l->ambient_sound_level[ambient_channel]; if (vol < 8) diff --git a/libs/audio/renderer/vorbis.c b/libs/audio/renderer/vorbis.c index bf3d8757b..1be9ed594 100644 --- a/libs/audio/renderer/vorbis.c +++ b/libs/audio/renderer/vorbis.c @@ -263,7 +263,7 @@ vorbis_stream_open (sfx_t *_sfx) QFS_FOpenFile (stream->file, &file); if (!file) return 0; - +puts (stream->file); sfx = calloc (1, sizeof (sfx_t)); samples = shm->speed * 0.3; size = samples = (samples + 255) & ~255;