summaryrefslogtreecommitdiff
path: root/ghc
diff options
context:
space:
mode:
authorSylvain HENRY <hsyl20@gmail.com>2016-11-02 14:55:06 -0400
committerBen Gamari <ben@smart-cactus.org>2016-11-02 14:55:07 -0400
commit8a5960ad874d31fcf631b4d427ccd9fae571745c (patch)
tree084ebb82c66de2fd4ac44591e3b6918baad0c044 /ghc
parent623b8e44b1647083ff5d85ef40b7cf88870acef5 (diff)
downloadhaskell-8a5960ad874d31fcf631b4d427ccd9fae571745c.tar.gz
Uninstall signal handlers
GHC installs signal handlers in runGhc/runGhcT to handle ^C but it never uninstalls them. It can be an issue, especially when using GHC as a library. Test Plan: validate Reviewers: bgamari, erikd, austin, simonmar Reviewed By: bgamari, simonmar Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2633 GHC Trac Issues: #4162
Diffstat (limited to 'ghc')
-rw-r--r--ghc/GHCi/UI.hs10
1 files changed, 5 insertions, 5 deletions
diff --git a/ghc/GHCi/UI.hs b/ghc/GHCi/UI.hs
index 3cc3f5c575..a3cb955bbe 100644
--- a/ghc/GHCi/UI.hs
+++ b/ghc/GHCi/UI.hs
@@ -1139,9 +1139,9 @@ afterRunStmt step_here run_result = do
afterRunStmt step_here >> return ()
flushInterpBuffers
- liftIO installSignalHandlers
- b <- isOptionSet RevertCAFs
- when b revertCAFs
+ withSignalHandlers $ do
+ b <- isOptionSet RevertCAFs
+ when b revertCAFs
return run_result
@@ -3626,8 +3626,8 @@ handler :: SomeException -> GHCi Bool
handler exception = do
flushInterpBuffers
- liftIO installSignalHandlers
- ghciHandle handler (showException exception >> return False)
+ withSignalHandlers $
+ ghciHandle handler (showException exception >> return False)
showException :: SomeException -> GHCi ()
showException se =