diff options
author | Simon Marlow <marlowsd@gmail.com> | 2011-08-12 14:26:34 +0100 |
---|---|---|
committer | Simon Marlow <marlowsd@gmail.com> | 2011-08-12 17:15:28 +0100 |
commit | d18b5d53e74318e4a6bc2ad0557ff71a00c1abe1 (patch) | |
tree | 52619880f0f98d3b13c7f2b8c0edd7e67369cec8 /rts/RtsStartup.c | |
parent | fa0406830b8c757ebaf3b0e8a1ca7967f7e0c9c7 (diff) | |
download | haskell-d18b5d53e74318e4a6bc2ad0557ff71a00c1abe1.tar.gz |
make shutdownHaskellAndExit() shut down the RTS and exit immediately
(#5402)
Diffstat (limited to 'rts/RtsStartup.c')
-rw-r--r-- | rts/RtsStartup.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/rts/RtsStartup.c b/rts/RtsStartup.c index c115701d6c..6e18fba273 100644 --- a/rts/RtsStartup.c +++ b/rts/RtsStartup.c @@ -424,12 +424,14 @@ shutdownHaskell(void) void shutdownHaskellAndExit(int n) { + // even if hs_init_count > 1, we still want to shut down the RTS + // and exit immediately (see #5402) + hs_init_count = 1; + // we're about to exit(), no need to wait for foreign calls to return. hs_exit_(rtsFalse); - if (hs_init_count == 0) { - stg_exit(n); - } + stg_exit(n); } #ifndef mingw32_HOST_OS |