aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-07-07 08:00:44 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-07-07 08:00:44 +0000
commit649237de8f9e1c784493f4a8f29178ac0e969237 (patch)
treeb8f71b62ea1bcf964f0da9d37b49d493ff21d754
parentac3c2866c74a703d5208a9001606ac4738daadbd (diff)
downloadruby-649237de8f9e1c784493f4a8f29178ac0e969237.tar.gz
* gc.c (rb_gc_call_finalizer_at_exit): deal with typed struct like
as obj_free(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23984 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog7
-rw-r--r--gc.c3
2 files changed, 7 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 92a8135853..cf68408a9b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,10 +1,11 @@
-Tue Jul 7 16:54:24 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Jul 7 17:00:38 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * gc.c (rb_gc_call_finalizer_at_exit): deal with typed struct like
+ as obj_free().
* error.c (rb_typed_struct_is_kind_of): new function to see if the
given typed struct.
-Tue Jul 7 13:44:49 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
* error.c (rb_check_typed_struct): new function to check typed
struct.
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));
}