diff options
author | darkvater <darkvater@openttd.org> | 2005-01-16 12:14:52 +0000 |
---|---|---|
committer | darkvater <darkvater@openttd.org> | 2005-01-16 12:14:52 +0000 |
commit | ef6ec2ac0469b6d19dfc677b3505a638339f2f4d (patch) | |
tree | 483ce86e20fc1a7037787e755e57f51a80bf1e4b | |
parent | 61a6bc544d9e656feb4458b6f9a86f7b7e01e7d6 (diff) | |
download | openttd-ef6ec2ac0469b6d19dfc677b3505a638339f2f4d.tar.xz |
(svn r1537) -Fix: Close all and any open filehandles open at shutdown (tamlin)
-rw-r--r-- | fileio.c | 4 | ||||
-rw-r--r-- | ttd.c | 7 |
2 files changed, 6 insertions, 5 deletions
@@ -83,11 +83,11 @@ void FioReadBlock(void *ptr, uint size) fread(ptr, 1, size, _fio.cur_fh); } -void FioCloseAll() +void FioCloseAll(void) { int i; - for(i=0; i!=lengthof(_fio.handles); i++) { + for (i = 0; i != lengthof(_fio.handles); i++) { if (_fio.handles[i] != NULL) { fclose(_fio.handles[i]); _fio.handles[i] = NULL; @@ -728,9 +728,7 @@ int ttd_main(int argc, char* argv[]) LoadIntroGame(); _switch_mode = SM_NONE; NetworkClientConnectGame(network_conn, rport); - } else { -// NetworkCoreConnectGame("auto", _network_server_port); - } + } } #endif /* ENABLE_NETWORK */ @@ -760,6 +758,9 @@ int ttd_main(int argc, char* argv[]) /* uninitialize variables that are allocated dynamic */ UnInitializeDynamicVariables(); + /* Close all and any open filehandles */ + FioCloseAll(); + return 0; } |