hedgewars/hwengine.pas
changeset 3052 1d60306f6b34
parent 3049 05ec3482930d
child 3053 55a7e3a896ef
--- a/hedgewars/hwengine.pas	Tue Mar 23 16:50:13 2010 +0000
+++ b/hedgewars/hwengine.pas	Tue Mar 23 16:53:45 2010 +0000
@@ -159,10 +159,8 @@
     ControllerClose();
     SendKB();
     CloseIPC();
-    freeEverything();
     TTF_Quit();
     SDL_Quit();
-    exit();
 end;
 
 ///////////////////
@@ -204,8 +202,6 @@
         end else SDL_Delay(1);
         if isTerminated = false then IPCCheckSock();
     until isTerminated;
-
-    exit();
 end;
 
 /////////////////////////
@@ -307,7 +303,6 @@
 
     MainLoop();
     OnDestroy();
-    exit();
 end;
 
 procedure initEverything;
@@ -578,6 +573,7 @@
     else if GameType = gmtSyntax then DisplayUsage()
     else Game();
     
+    freeEverything;
     if GameType = gmtSyntax then
         ExitCode:= 1
     else