From ffd0da0333dd413d041ce25e4066c97890343a0c Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 26 Aug 2009 09:49:28 +0000 Subject: * lib/tempfile.rb (Tempfile#close!): should not undefine finalizer by just unlink. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24666 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/tempfile.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/tempfile.rb b/lib/tempfile.rb index 57127c7214..34d036fd6a 100644 --- a/lib/tempfile.rb +++ b/lib/tempfile.rb @@ -126,6 +126,7 @@ class Tempfile < DelegateClass(File) def close! _close unlink + ObjectSpace.undefine_finalizer(self) end # Unlinks the file. On UNIX-like systems, it is often a good idea @@ -143,7 +144,6 @@ class Tempfile < DelegateClass(File) # remove tmpname and cleanlist from callback @data[0] = @data[2] = nil @data = @tmpname = nil - ObjectSpace.undefine_finalizer(self) rescue Errno::EACCES # may not be able to unlink on Windows; just ignore end -- cgit v1.2.3