From: Ian Lynagh Date: Thu, 11 Dec 2008 17:00:06 +0000 (+0000) Subject: The default cleanup handler should /always/ delete the temp files X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=3db6d1b8f2272f27e947e5347268a576452a6e77;hp=2d4e1203c6a5ee5634c0af5404d9a8ad2b338cf1 The default cleanup handler should /always/ delete the temp files Not only if there has been an exception. It worked for GHC anyway, as it was getting an ExitSuccess exception, but GHC API clients shouldn't be required to do that. --- diff --git a/compiler/main/GHC.hs b/compiler/main/GHC.hs index a5d82b8..00d5cbe 100644 --- a/compiler/main/GHC.hs +++ b/compiler/main/GHC.hs @@ -373,7 +373,7 @@ defaultCleanupHandler :: (ExceptionMonad m, MonadIO m) => DynFlags -> m a -> m a defaultCleanupHandler dflags inner = -- make sure we clean up after ourselves - inner `gonException` + inner `gfinally` (liftIO $ do cleanTempFiles dflags cleanTempDirs dflags