The default cleanup handler should /always/ delete the temp files
authorIan Lynagh <igloo@earth.li>
Thu, 11 Dec 2008 17:00:06 +0000 (17:00 +0000)
committerIan Lynagh <igloo@earth.li>
Thu, 11 Dec 2008 17:00:06 +0000 (17:00 +0000)
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.

compiler/main/GHC.hs

index a5d82b8..00d5cbe 100644 (file)
@@ -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