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
|
||||
//
|
||||
|
||||
static int *handles;
|
||||
static int num_handles;
|
||||
static int *handles = NULL;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
handles = I_Realloc(handles, (num_handles + 1) * sizeof(*handles));
|
||||
handles[num_handles++] = handle;
|
||||
array_push(handles, handle);
|
||||
|
||||
free(filename); // killough 11/98
|
||||
|
||||
@ -630,7 +628,7 @@ void W_CloseFileDescriptors(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < num_handles; ++i)
|
||||
for (i = 0; i < array_size(handles); ++i)
|
||||
{
|
||||
close(handles[i]);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user