From fab993acfa6b083c3fa96f819c084dc7265c4a31 Mon Sep 17 00:00:00 2001 From: eagletmt Date: Tue, 14 Feb 2012 19:14:21 +0900 Subject: [PATCH] cleanup temporaries --- GHCApi.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/GHCApi.hs b/GHCApi.hs index a693b5f..fa6f7a6 100644 --- a/GHCApi.hs +++ b/GHCApi.hs @@ -12,7 +12,9 @@ import Types ---------------------------------------------------------------- withGHC :: (MonadPlus m) => Ghc (m a) -> IO (m a) -withGHC body = ghandle ignore $ runGhc (Just libdir) body +withGHC body = ghandle ignore $ runGhc (Just libdir) $ do + dflags <- getSessionDynFlags + defaultCleanupHandler dflags body where ignore :: (MonadPlus m) => SomeException -> IO (m a) ignore _ = return mzero