diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-08-26 09:49:28 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-08-26 09:49:28 +0000 |
commit | e21ad1945d376f2638c2613ede509f054221b370 (patch) | |
tree | 13c217d06d43469bad1b649972ae1f61b3c7d4fd /lib/tempfile.rb | |
parent | 864d8137440bab94f8e3c081fe102d31d12e43d4 (diff) | |
download | ruby-e21ad1945d376f2638c2613ede509f054221b370.tar.gz ruby-e21ad1945d376f2638c2613ede509f054221b370.tar.xz ruby-e21ad1945d376f2638c2613ede509f054221b370.zip |
* lib/tempfile.rb (Tempfile#close!): should not undefine finalizer
by just unlink.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24666 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/tempfile.rb')
-rw-r--r-- | lib/tempfile.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/tempfile.rb b/lib/tempfile.rb index 57127c721..34d036fd6 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 |