(svn r1537) -Fix: Close all and any open filehandles open at shutdown (tamlin)
authordarkvater
Sun, 16 Jan 2005 12:14:52 +0000
changeset 1036 5f0c307fbadd
parent 1035 0a170deb6e33
child 1037 60bb8079eeea
(svn r1537) -Fix: Close all and any open filehandles open at shutdown (tamlin)
fileio.c
ttd.c
--- a/fileio.c	Sun Jan 16 11:24:58 2005 +0000
+++ b/fileio.c	Sun Jan 16 12:14:52 2005 +0000
@@ -83,11 +83,11 @@
 	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;
--- a/ttd.c	Sun Jan 16 11:24:58 2005 +0000
+++ b/ttd.c	Sun Jan 16 12:14:52 2005 +0000
@@ -728,9 +728,7 @@
 			LoadIntroGame();
 			_switch_mode = SM_NONE;
 			NetworkClientConnectGame(network_conn, rport);
-		} else {
-//			NetworkCoreConnectGame("auto", _network_server_port);
-		}
+		} 
 	}
 #endif /* ENABLE_NETWORK */
 
@@ -760,6 +758,9 @@
 	/* uninitialize variables that are allocated dynamic */
 	UnInitializeDynamicVariables();
 
+	/* Close all and any open filehandles */
+	FioCloseAll();
+
 	return 0;
 }