Waldek Hebisch wrote:
Adriaan van Os wrote:
procedure Finalize1; begin FlushAllFiles; RestoreTerminal (True); Done_Files; if ErrorMessageString <> '' then WriteStackDump end;
Does Done_Files also operate on StdErr ?? The crash disappears if I comment out the Done_Files call;
It looks so (Frank knows better). Good catch.
Ouch! Yes, `WriteErrorMessage' accesses (via `FileHandle') a field of already disposed `StdErr' variable -- an evil bug, as it happens to work often (especially if the field is in the middle of a bigger structure, as is the case here), so it wasn't noticed so far. But, of course, it's wrong, and now it crashed ...
`Done_Files' probably should go after `WriteStackDump'.
Yes, try swapping the two statements.
Frank