summaryrefslogtreecommitdiff
path: root/lib/tempfile.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-10-01 13:03:58 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-10-01 13:03:58 +0000
commitec2db8decf97b79aef557c4b81eef3a0479f4ae3 (patch)
treea06beca0521251d5e1a6ae50493fb0f7e8923a39 /lib/tempfile.rb
parent57c7de44fc6592136e40c08f88430ce9cf83cc93 (diff)
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 [ruby-core:56521] [Bug #8768] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43110 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/tempfile.rb')
-rw-r--r--lib/tempfile.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/tempfile.rb b/lib/tempfile.rb
index e7df7d6..92a73f8 100644
--- a/lib/tempfile.rb
+++ b/lib/tempfile.rb
@@ -190,7 +190,6 @@ class Tempfile < DelegateClass(File)
def close!
_close
unlink
- ObjectSpace.undefine_finalizer(self)
end
# Unlinks (deletes) the file from the filesystem. One should always unlink
@@ -238,6 +237,7 @@ class Tempfile < DelegateClass(File)
# remove tmpname from remover
@data[0] = @data[1] = nil
@tmpname = nil
+ ObjectSpace.undefine_finalizer(self)
end
alias delete unlink