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

* gc.c (define_final, undefine_final): shouldn't add/remove finalizer

of forzen objects.

	* gc.c (undefine_final): should remove FL_FINALIZE flag.
	  [ruby-dev:37964] (also see [ruby-dev:37959])



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22240 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
usa 2009-02-11 09:11:48 +00:00
parent a2c779be35
commit e3c5fbba91
2 changed files with 11 additions and 0 deletions

View file

@ -1,3 +1,11 @@
Wed Feb 11 18:09:41 2009 NAKAMURA Usaku <usa@ruby-lang.org>
* gc.c (define_final, undefine_final): shouldn't add/remove finalizer
of forzen objects.
* gc.c (undefine_final): should remove FL_FINALIZE flag.
[ruby-dev:37964] (also see [ruby-dev:37959])
Wed Feb 11 17:37:41 2009 Tanaka Akira <akr@fsij.org>
* ext/socket/lib/socket.rb (Socket.udp_server_sockets): call the block

3
gc.c
View file

@ -2261,9 +2261,11 @@ static VALUE
undefine_final(VALUE os, VALUE obj)
{
rb_objspace_t *objspace = &rb_objspace;
if (OBJ_FROZEN(obj)) rb_error_frozen("object");
if (finalizer_table) {
st_delete(finalizer_table, (st_data_t*)&obj, 0);
}
FL_UNSET(obj, FL_FINALIZE);
return obj;
}
@ -2283,6 +2285,7 @@ define_final(int argc, VALUE *argv, VALUE os)
VALUE obj, block, table;
rb_scan_args(argc, argv, "11", &obj, &block);
if (OBJ_FROZEN(obj)) rb_error_frozen("object");
if (argc == 1) {
block = rb_block_proc();
}