diff options
author | nari <nari@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-11-29 22:56:02 +0000 |
---|---|---|
committer | nari <nari@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-11-29 22:56:02 +0000 |
commit | 59770bf960aba2ef14cb5306606bbb6a64d38188 (patch) | |
tree | 580330be3d453f2a7a2fb4ef03557b738f2ff5dd /test | |
parent | c86379402c8dfeab9504c39c2de435601d408e57 (diff) | |
download | ruby-59770bf960aba2ef14cb5306606bbb6a64d38188.tar.gz |
* gc.c (rb_objspace_call_finalizer): finalize_deferred may free up
a object which is reachable from a part after this function,
e.g. ruby_vm_destruct(). [ruby-dev:46647] [Bug #7452]
* test/ruby/test_gc.rb (test_finalizing_main_thread): add a test
for above.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38010 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_gc.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/ruby/test_gc.rb b/test/ruby/test_gc.rb index 9d68c1a9c0..11d2b4c596 100644 --- a/test/ruby/test_gc.rb +++ b/test/ruby/test_gc.rb @@ -134,4 +134,10 @@ class TestGc < Test::Unit::TestCase ensure GC::Profiler.disable end + + def test_finalizing_main_thread + assert_in_out_err(%w[--disable-gems], <<-EOS, ["\"finalize\""], [], "[ruby-dev:46647]") + ObjectSpace.define_finalizer(Thread.main) { p 'finalize' } + EOS + end end |