[前][次][番号順一覧][スレッド一覧]

ruby-changes:12928

From: nobu <ko1@a...>
Date: Wed, 26 Aug 2009 18:49:47 +0900 (JST)
Subject: [ruby-changes:12928] Ruby:r24666 (trunk): * lib/tempfile.rb (Tempfile#close!): should not undefine finalizer

nobu	2009-08-26 18:49:28 +0900 (Wed, 26 Aug 2009)

  New Revision: 24666

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=24666

  Log:
    * lib/tempfile.rb (Tempfile#close!): should not undefine finalizer
      by just unlink.

  Modified files:
    trunk/ChangeLog
    trunk/lib/tempfile.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 24665)
+++ ChangeLog	(revision 24666)
@@ -1,3 +1,8 @@
+Wed Aug 26 18:49:22 2009  Nobuyoshi Nakada  <nobu@r...>
+
+	* lib/tempfile.rb (Tempfile#close!): should not undefine finalizer
+	  by just unlink.
+
 Wed Aug 26 17:00:31 2009  Nobuyoshi Nakada  <nobu@r...>
 
 	* tool/mkconfig.rb (program_transform_name): fix for autoconf 2.61
Index: lib/tempfile.rb
===================================================================
--- lib/tempfile.rb	(revision 24665)
+++ lib/tempfile.rb	(revision 24666)
@@ -126,6 +126,7 @@
   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 @@
       # 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

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]