[PATCH] tempfile: undefine finalizer on unlink
- lib/tempfile.rb (Tempfile#unlink): undefine finalizer
running the finalizer on an unlinked Tempfile leads to a confusing
"removing ...done" message when using --debug. We can rely on
normal GC to close. rb_io_fptr_finalize will take care of closing
the descriptor without the extra finalizer for Tempfile.
#2 [ruby-core:57247] Updated by Nobuyoshi Nakada almost 3 years ago
I couldn't let the test fail with the current code, but succeeded by setting $DEBUG at the end.
args = %w(--disable-gems -rtempfile)
assert_in_out_err(args, <<-'EOS') do |(filename), (error)|
tmp = Tempfile.new('foo')
$DEBUG = true
assert_nil error, "we used to get a confusing 'removing ...done' here"
#4 Updated by Nobuyoshi Nakada almost 3 years ago
- Status changed from Assigned to Closed
- % Done changed from 0 to 100
This issue was solved with changeset r43110.
Eric, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.
tempfile.rb: undefine finalizer on unlink
- lib/tempfile.rb (Tempfile#unlink): finalizer is no longer needed after unlinking. patched by by normalperson (Eric Wong) at [Bug #8768]