mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-23 04:42:32 +00:00
fix file handle leak
This commit is contained in:
parent
beb5438484
commit
097be5a093
1 changed files with 8 additions and 7 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue