mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* gc.c (chain_finalized_object): should not delete from finalizer
table until run. * gc.c (rb_gc_call_finalizer_at_exit): deferred_final_list may be empty first. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17737 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
d0f211f394
commit
ac388541c4
2 changed files with 12 additions and 3 deletions
|
@ -1,3 +1,11 @@
|
|||
Mon Jun 30 22:12:46 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* gc.c (chain_finalized_object): should not delete from finalizer
|
||||
table until run.
|
||||
|
||||
* gc.c (rb_gc_call_finalizer_at_exit): deferred_final_list may be
|
||||
empty first.
|
||||
|
||||
Mon Jun 30 18:57:05 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* gc.c (gc_finalize_deferred): allow object allocation in finalizers.
|
||||
|
|
7
gc.c
7
gc.c
|
@ -2041,7 +2041,7 @@ chain_finalized_object(st_data_t key, st_data_t val, st_data_t arg)
|
|||
p->as.free.next = *final_list;
|
||||
*final_list = p;
|
||||
}
|
||||
return ST_DELETE;
|
||||
return ST_CONTINUE;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -2053,12 +2053,13 @@ rb_gc_call_finalizer_at_exit(void)
|
|||
|
||||
/* run finalizers */
|
||||
if (need_call_final) {
|
||||
while ((p = deferred_final_list) != 0) {
|
||||
do {
|
||||
p = deferred_final_list;
|
||||
deferred_final_list = 0;
|
||||
finalize_list(objspace, p);
|
||||
st_foreach(finalizer_table, chain_finalized_object,
|
||||
(st_data_t)&deferred_final_list);
|
||||
}
|
||||
} while (deferred_final_list);
|
||||
}
|
||||
/* finalizers are part of garbage collection */
|
||||
during_gc++;
|
||||
|
|
Loading…
Add table
Reference in a new issue