# HG changeset patch # User sheepluva # Date 1523132196 -7200 # Node ID 092adcf707c5a0d5fc398102ef381eb23b3e12de # Parent 574d34577ee9855b8018d64bdf46d0f295e129d7 Fix segfault on game halt (if no logfile) diff -r 574d34577ee9 -r 092adcf707c5 hedgewars/uUtils.pas --- a/hedgewars/uUtils.pas Fri Apr 06 12:34:23 2018 -0400 +++ b/hedgewars/uUtils.pas Sat Apr 07 22:16:36 2018 +0200 @@ -751,9 +751,14 @@ procedure freeModule; begin {$IFDEF DEBUGFILE} +if logFile <> nil then + begin pfsWriteLn(logFile, 'halt at ' + inttostr(GameTicks) + ' ticks. TurnTimeLeft = ' + inttostr(TurnTimeLeft)); pfsFlush(logFile); pfsClose(logFile); + end +else + WriteLn(stdout, 'halt at ' + inttostr(GameTicks) + ' ticks. TurnTimeLeft = ' + inttostr(TurnTimeLeft)); {$IFDEF USE_VIDEO_RECORDING} DoneCriticalSection(logMutex); {$ENDIF}