mirror of
https://github.com/fabiangreffrath/woof.git
synced 2025-09-22 03:12:00 -04:00
use m_array for file handles
This commit is contained in:
parent
849eb0ed71
commit
1c1b3f1e8f
@ -84,8 +84,7 @@ void ExtractFileBase(const char *path, char *dest)
|
|||||||
// Reload hack removed by Lee Killough
|
// Reload hack removed by Lee Killough
|
||||||
//
|
//
|
||||||
|
|
||||||
static int *handles;
|
static int *handles = NULL;
|
||||||
static int num_handles;
|
|
||||||
|
|
||||||
static void W_AddFile(const char *name) // killough 1/31/98: static, const
|
static void W_AddFile(const char *name) // killough 1/31/98: static, const
|
||||||
{
|
{
|
||||||
@ -151,8 +150,7 @@ static void W_AddFile(const char *name) // killough 1/31/98: static, const
|
|||||||
numlumps += header.numlumps;
|
numlumps += header.numlumps;
|
||||||
}
|
}
|
||||||
|
|
||||||
handles = I_Realloc(handles, (num_handles + 1) * sizeof(*handles));
|
array_push(handles, handle);
|
||||||
handles[num_handles++] = handle;
|
|
||||||
|
|
||||||
free(filename); // killough 11/98
|
free(filename); // killough 11/98
|
||||||
|
|
||||||
@ -630,7 +628,7 @@ void W_CloseFileDescriptors(void)
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < num_handles; ++i)
|
for (i = 0; i < array_size(handles); ++i)
|
||||||
{
|
{
|
||||||
close(handles[i]);
|
close(handles[i]);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user