fix file handle leak

This commit is contained in:
Bill Currie 2007-05-07 14:03:36 +00:00 committed by Jeff Teunissen
parent beb5438484
commit 097be5a093

View file

@ -161,13 +161,6 @@ SND_ScanChannels (int wait)
#endif
} while (count);
Sys_DPrintf ("scanning done.\n");
for (i = 0; i < MAX_CHANNELS; i++) {
ch = &snd_channels[i];
if (!ch->sfx)
continue;
ch->sfx->release (ch->sfx);
ch->sfx = 0;
}
} else {
for (i = 0; i < MAX_CHANNELS; i++) {
ch = &snd_channels[i];
@ -178,6 +171,14 @@ SND_ScanChannels (int wait)
}
//printf ("count: %d\n", count);
}
for (i = 0; i < MAX_CHANNELS; i++) {
ch = &snd_channels[i];
if (!ch->sfx || !ch->done)
continue;
ch->sfx->release (ch->sfx);
ch->sfx->close (ch->sfx);
ch->sfx = 0;
}
}
void