# HG changeset patch # User sheepluva # Date 1273265103 0 # Node ID 033e4a8a9c7457ea9f8a68b2c87daa971a2b01fe # Parent b79908461a115f0aea1c6594d525e911ab77d54a wait for AI thread to finish before freeing ressources (to avoid segfaults on game exit) diff -r b79908461a11 -r 033e4a8a9c74 hedgewars/hwengine.pas --- a/hedgewars/hwengine.pas Fri May 07 20:38:55 2010 +0000 +++ b/hedgewars/hwengine.pas Fri May 07 20:45:03 2010 +0000 @@ -90,7 +90,7 @@ var s: shortstring; {$ENDIF} begin - inc(RealTicks, Lag); + if not isPaused then inc(RealTicks, Lag); case GameState of gsLandGen: begin @@ -121,13 +121,19 @@ gsGame: begin DrawWorld(Lag); // never place between ProcessKbd and DoGameTick - bugs due to /put cmd and isCursorVisible ProcessKbd; - DoGameTick(Lag); - if not isPaused then ProcessVisualGears(Lag); + if not isPaused then + begin + DoGameTick(Lag); + ProcessVisualGears(Lag); + end; end; gsChat: begin DrawWorld(Lag); - DoGameTick(Lag); - ProcessVisualGears(Lag); + if not isPaused then + begin + DoGameTick(Lag); + ProcessVisualGears(Lag); + end; end; gsExit: begin isTerminated:= true; @@ -156,6 +162,7 @@ begin WriteLnToConsole('Freeing resources...'); if isSoundEnabled then ReleaseSound(); + FreeActionsList(); StoreRelease(); FreeGearsList(); FreeVisualGears();