summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/gc.c b/gc.c
index 96974dba2d..f5c03081f0 100644
--- a/gc.c
+++ b/gc.c
@@ -1133,13 +1133,12 @@ rb_gc_call_finalizer_at_exit()
p = heaps[i]; pend = p + HEAP_SLOTS;
while (p < pend) {
if (BUILTIN_TYPE(p) == T_DATA &&
- DATA_PTR(p) &&
- RANY(p)->as.data.dfree)
+ DATA_PTR(p) && RANY(p)->as.data.dfree) {
(*RANY(p)->as.data.dfree)(DATA_PTR(p));
-#if 0
- else if (BUILTIN_TYPE(p))
- obj_free((VALUE)p);
-#endif
+ }
+ else if (BUILTIN_TYPE(p) == T_FILE) {
+ rb_io_fptr_finalize(RANY(p)->as.file.fptr);
+ }
p++;
}
}