summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gc.c b/gc.c
index 36cb6d1d5d..4dbc59475b 100644
--- a/gc.c
+++ b/gc.c
@@ -988,10 +988,18 @@ gc_call_finalizer_at_exit()
RVALUE *p, *pend;
int i;
+ /* run finalizers */
for (i = 0; i < heaps_used; i++) {
p = heaps[i]; pend = p + HEAP_SLOTS;
while (p < pend) {
run_final(p);
+ p++;
+ }
+ }
+ /* run data object's finaliers */
+ for (i = 0; i < heaps_used; i++) {
+ p = heaps[i]; pend = p + HEAP_SLOTS;
+ while (p < pend) {
if (BUILTIN_TYPE(p) == T_DATA &&
DATA_PTR(p) &&
RANY(p)->as.data.dfree)