diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-03-23 10:55:39 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-03-23 10:55:39 +0000 |
commit | 100074c178ca336b3017f1d2564c70c32ac9d925 (patch) | |
tree | b80d20a7cf42c56528dd53f3ebe1e739d057bd53 | |
parent | 8f8a31b0e9972ea9495331980561d548d1ebd72e (diff) | |
download | ruby-100074c178ca336b3017f1d2564c70c32ac9d925.tar.gz |
* gc.c (rb_gc_call_finalizer_at_exit): use free() if dfree is -1.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3600 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | gc.c | 7 |
2 files changed, 10 insertions, 1 deletions
@@ -1,3 +1,7 @@ +Sun Mar 23 19:54:53 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net> + + * gc.c (rb_gc_call_finalizer_at_exit): use free() if dfree is -1. + Sat Mar 22 15:50:29 2003 Tanaka Akira <akr@m17n.org> * time.c (make_time_t): try search_time_t if mktime/timegm is failed. @@ -1547,7 +1547,12 @@ rb_gc_call_finalizer_at_exit() if (BUILTIN_TYPE(p) == T_DATA && DATA_PTR(p) && RANY(p)->as.data.dfree) { p->as.free.flags = 0; - (*RANY(p)->as.data.dfree)(DATA_PTR(p)); + if ((long)RANY(p)->as.data.dfree == -1) { + RUBY_CRITICAL(free(DATA_PTR(p))); + } + else if (RANY(p)->as.data.dfree) { + (*RANY(p)->as.data.dfree)(DATA_PTR(p)); + } } else if (BUILTIN_TYPE(p) == T_FILE) { p->as.free.flags = 0; |