hedgewars/uIO.pas
changeset 7026 8d1724e1337e
parent 6982 8d41d22a291d
child 7028 0f60591f3a16
--- a/hedgewars/uIO.pas	Sat May 05 17:19:33 2012 +0100
+++ b/hedgewars/uIO.pas	Sat May 05 17:29:04 2012 +0100
@@ -25,6 +25,7 @@
 procedure initModule;
 procedure freeModule;
 
+procedure InitIPC;
 procedure SendIPC(s: shortstring);
 procedure SendIPCc(c: char);
 procedure SendIPCXY(cmd: char; X, Y: SmallInt);
@@ -35,8 +36,6 @@
 procedure SendStat(sit: TStatInfoType; s: shortstring);
 procedure IPCWaitPongEvent;
 procedure IPCCheckSock;
-procedure InitIPC;
-procedure CloseIPC;
 procedure NetGetNextCmd;
 procedure doPut(putX, putY: LongInt; fromAI: boolean);
 
@@ -112,13 +111,6 @@
     WriteLnToConsole(msgOK)
 end;
 
-procedure CloseIPC;
-begin
-    SDLNet_FreeSocketSet(fds);
-    SDLNet_TCP_Close(IPCSock);
-    SDLNet_Quit();
-end;
-
 procedure ParseIPCCommand(s: shortstring);
 var loTicks: Word;
 begin
@@ -443,7 +435,10 @@
 
 procedure freeModule;
 begin
-while headcmd <> nil do RemoveCmd
+    while headcmd <> nil do RemoveCmd;
+    SDLNet_FreeSocketSet(fds);
+    SDLNet_TCP_Close(IPCSock);
+    SDLNet_Quit();
 end;
 
 end.