FIX #1364: added support for C finalizers that run as soon as the value is not longer...
[ghc-hetmet.git] / rts / RtsStartup.c
index fbebdb9..6abeb40 100644 (file)
@@ -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 */