[PATCH] tempfile: undefine finalizer on unlink
|ruby -v:||ruby 2.1.0dev (2013-08-10 trunk 42491) [x86_64-linux]||Backport:||1.9.3: DONE, 2.0.0: DONE|
- 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. rbiofptr_finalize will take care of closing
the descriptor without the extra finalizer for Tempfile.
#2 Updated by Nobuyoshi Nakada 7 months 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)
assertinouterr(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 7 months 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]