diff options
author | Simon Marlow <marlowsd@gmail.com> | 2008-12-10 15:04:25 +0000 |
---|---|---|
committer | Simon Marlow <marlowsd@gmail.com> | 2008-12-10 15:04:25 +0000 |
commit | 6c095bfa3c8c81b52ad92853acd326453d320d7b (patch) | |
tree | 3f7658288a4f7f0744bb4959ca5a6113cf02babd /rts/RtsStartup.c | |
parent | d4a17c3a253d02c2ebf2315e71a29cb740278977 (diff) | |
download | haskell-6c095bfa3c8c81b52ad92853acd326453d320d7b.tar.gz |
FIX #1364: added support for C finalizers that run as soon as the value is not longer reachable.
Patch originally by Ivan Tomac <tomac@pacific.net.au>, amended by
Simon Marlow:
- mkWeakFinalizer# commoned up with mkWeakFinalizerEnv#
- GC parameters to ALLOC_PRIM fixed
Diffstat (limited to 'rts/RtsStartup.c')
-rw-r--r-- | rts/RtsStartup.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/rts/RtsStartup.c b/rts/RtsStartup.c index fbebdb9c41..6abeb404a0 100644 --- a/rts/RtsStartup.c +++ b/rts/RtsStartup.c @@ -414,6 +414,9 @@ hs_exit_(rtsBool wait_foreign) /* stop all running tasks */ exitScheduler(wait_foreign); + + /* run C finalizers for all active weak pointers */ + runAllCFinalizers(weak_ptr_list); #if defined(GRAN) /* end_gr_simulation prints global stats if requested -- HWL */ |