From 422366027d23ed1d57902adaa9360e386fb6ae7c Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Thu, 11 Dec 2008 17:01:04 +0000 Subject: Wrap the GHC usage with defaultCleanupHandler This fixes a bug where haddock leaves /tmp/ghc* directories uncleaned. --- src/Haddock/GHC.hs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/Haddock/GHC.hs') 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 -- cgit v1.2.3