diff options
| -rw-r--r-- | ChangeLog | 5 | ||||
| -rw-r--r-- | lib/tempfile.rb | 5 | ||||
| -rw-r--r-- | version.h | 2 |
3 files changed, 10 insertions, 2 deletions
@@ -1,3 +1,8 @@ +Wed May 20 06:20:05 2009 Yukihiro Matsumoto <matz@ruby-lang.org> + + * lib/tempfile.rb (Tempfile#unlink): close first for Windows. a + patch from Florian Frank. [ruby-core:23505] + Wed May 20 00:05:52 2009 Yukihiro Matsumoto <matz@ruby-lang.org> * vm_method.c (rb_attr): should preserve encoding info. diff --git a/lib/tempfile.rb b/lib/tempfile.rb index 601bb8d2f8..3319d4f886 100644 --- a/lib/tempfile.rb +++ b/lib/tempfile.rb @@ -136,7 +136,10 @@ class Tempfile < DelegateClass(File) def unlink # keep this order for thread safeness begin - File.unlink(@tmpname) if File.exist?(@tmpname) + if File.exist?(@tmpname) + closed? or close + File.unlink(@tmpname) + end @@cleanlist.delete(@tmpname) @data = @tmpname = nil ObjectSpace.undefine_finalizer(self) @@ -1,6 +1,6 @@ #define RUBY_VERSION "1.9.1" #define RUBY_RELEASE_DATE "2009-05-12" -#define RUBY_PATCHLEVEL 151 +#define RUBY_PATCHLEVEL 152 #define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MINOR 9 #define RUBY_VERSION_TEENY 1 |
