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

git-svn-id: trunk@27835 -
This commit is contained in:
marco 2014-05-31 15:06:42 +00:00
parent 0a0739b916
commit b7aff4eae0

View File

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