summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--lib/tempfile.rb2
2 files changed, 6 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index b0e553a..4082137 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Wed Aug 26 18:49:22 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/tempfile.rb (Tempfile#close!): should not undefine finalizer
+ by just unlink.
+
Wed Aug 26 17:00:31 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* tool/mkconfig.rb (program_transform_name): fix for autoconf 2.61
diff --git a/lib/tempfile.rb b/lib/tempfile.rb
index 57127c7..34d036f 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