Browse Source

* flush output on halt. Patch by Mattias mantis #26225

git-svn-id: trunk@27835 -
marco 11 years ago
parent
commit
b7aff4eae0
1 changed files with 15 additions and 0 deletions
  1. 15 0
      utils/fpcres/msghandler.pas

+ 15 - 0
utils/fpcres/msghandler.pas

@@ -41,13 +41,22 @@ type
     destructor Destroy; override;
     procedure DoError(const aMsg : string);
     procedure DoVerbose(const aMsg : string);
+    procedure Flush;
     property Verbose : boolean read fVerbose write SetVerbose;
   end;
   
 var Messages : TMessages;
 
+procedure Halt(errnum:Longint);
+
 implementation
 
+procedure Halt(errnum:Longint);
+begin
+  Messages.Flush;
+  System.Halt(errnum);
+end;
+
 { TMessages }
 
 procedure TMessages.SetVerbose(const aValue: boolean);
@@ -95,6 +104,12 @@ begin
     writeln(fStdOut,'Debug: '+aMsg);
 end;
 
+procedure TMessages.Flush;
+begin
+  System.Flush(fStdOut);
+  System.Flush(fStdErr);
+end;
+
 initialization
   Messages:=TMessages.Create;