summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-04-21 09:43:44 +0000
committerknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-04-21 09:43:44 +0000
commit7f6df101caca14f3bc68226ff33b7301ffbe6d74 (patch)
treeb3117987ebd279a77401d5f638cce8e2bbc37d35 /lib
parentc2ace60b081c587532ba01ffebd6f4c1fe84e643 (diff)
Merge from ruby_1_8.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@16127 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/tempfile.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/tempfile.rb b/lib/tempfile.rb
index f87c5fd394..c984cd3393 100644
--- a/lib/tempfile.rb
+++ b/lib/tempfile.rb
@@ -95,7 +95,8 @@ class Tempfile < DelegateClass(File)
def _close # :nodoc:
@tmpfile.close if @tmpfile
- @data[1] = @tmpfile = nil
+ @tmpfile = nil
+ @data[1] = nil if @data
end
protected :_close
@@ -117,6 +118,7 @@ class Tempfile < DelegateClass(File)
_close
@clean_proc.call
ObjectSpace.undefine_finalizer(self)
+ @data = @tmpname = nil
end
# Unlinks the file. On UNIX-like systems, it is often a good idea