1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
nobu 2003-03-23 10:55:39 +00:00
parent 8f8a31b0e9
commit 100074c178
2 changed files with 10 additions and 1 deletions

View file

@ -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> 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. * time.c (make_time_t): try search_time_t if mktime/timegm is failed.

7
gc.c
View file

@ -1547,7 +1547,12 @@ rb_gc_call_finalizer_at_exit()
if (BUILTIN_TYPE(p) == T_DATA && if (BUILTIN_TYPE(p) == T_DATA &&
DATA_PTR(p) && RANY(p)->as.data.dfree) { DATA_PTR(p) && RANY(p)->as.data.dfree) {
p->as.free.flags = 0; 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) { else if (BUILTIN_TYPE(p) == T_FILE) {
p->as.free.flags = 0; p->as.free.flags = 0;