aboutsummaryrefslogtreecommitdiff
path: root/src/Haddock
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2008-12-11 17:01:04 +0000
committerIan Lynagh <igloo@earth.li>2008-12-11 17:01:04 +0000
commit422366027d23ed1d57902adaa9360e386fb6ae7c (patch)
tree9060ced375ce05750d660ec1aa7a725b36c42f94 /src/Haddock
parent202f6995495614a329cb79c91a56384492239df3 (diff)
Wrap the GHC usage with defaultCleanupHandler
This fixes a bug where haddock leaves /tmp/ghc* directories uncleaned.
Diffstat (limited to 'src/Haddock')
-rw-r--r--src/Haddock/GHC.hs11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/Haddock/GHC.hs b/src/Haddock/GHC.hs
index 0d047080..7856273e 100644
--- a/src/Haddock/GHC.hs
+++ b/src/Haddock/GHC.hs
@@ -52,12 +52,13 @@ startGhc libDir flags = do
ghcLink = NoLink
}
dynflags''' <- parseGhcFlags dynflags'' restFlags flags
-#if __GLASGOW_HASKELL__ >= 609
- setSessionDynFlags dynflags'''
- ghcActs dynflags'''
+ defaultCleanupHandler dynflags''' $ do
+#if __GLASGOW_HASKELL__ >= 609
+ setSessionDynFlags dynflags'''
+ ghcActs dynflags'''
#else
- setSessionDynFlags session dynflags'''
- return (session, dynflags''')
+ setSessionDynFlags session dynflags'''
+ return (session, dynflags''')
#endif