From: wolfgang Date: Mon, 24 Jan 2005 04:26:17 +0000 (+0000) Subject: [project @ 2005-01-24 04:26:17 by wolfgang] X-Git-Tag: nhc98-1-18-release~79 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=b1a8cc5717dce52c79dc304e2bd7555592fc52be;p=haskell-directory.git [project @ 2005-01-24 04:26:17 by wolfgang] Always flush stdout & stderr at exit, even when terminating abnormally due to an exception. --- diff --git a/GHC/TopHandler.lhs b/GHC/TopHandler.lhs index 7e5bca4..829752e 100644 --- a/GHC/TopHandler.lhs +++ b/GHC/TopHandler.lhs @@ -58,14 +58,15 @@ topHandler err = catchException (real_handler err) topHandler -- real_handler :: Exception -> IO a real_handler ex = + cleanUp >> case ex of AsyncException StackOverflow -> do reportStackOverflow safeExit 2 -- only the main thread gets ExitException exceptions - ExitException ExitSuccess -> cleanUp >> safeExit 0 - ExitException (ExitFailure n) -> cleanUp >> safeExit n + ExitException ExitSuccess -> safeExit 0 + ExitException (ExitFailure n) -> safeExit n other -> do reportError other