summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gc.c b/gc.c
index b49e221df9..11bcd3b348 100644
--- a/gc.c
+++ b/gc.c
@@ -2802,6 +2802,9 @@ rb_gc_call_finalizer_at_exit(void)
DATA_PTR(p) && RANY(p)->as.data.dfree &&
RANY(p)->as.basic.klass != rb_cThread && RANY(p)->as.basic.klass != rb_cMutex) {
p->as.free.flags = 0;
+ if (RTYPEDDATA_P(p)) {
+ RDATA(p)->dfree = RANY(p)->as.typeddata.type->dfree;
+ }
if ((long)RANY(p)->as.data.dfree == -1) {
xfree(DATA_PTR(p));
}