1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* lib/tempfile.rb (Tempfile#unlink): close first for Windows. a

patch from Florian Frank.  [ruby-core:23505]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23494 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2009-05-20 00:35:30 +00:00
parent 91e5ba1cb8
commit c81863c321
2 changed files with 9 additions and 1 deletions

View file

@ -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:13:38 2009 Yukihiro Matsumoto <matz@ruby-lang.org> Wed May 20 00:13:38 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
* encoding.c (rb_enc_codepoint_len): combine rb_enc_codepoint() * encoding.c (rb_enc_codepoint_len): combine rb_enc_codepoint()

View file

@ -136,7 +136,10 @@ class Tempfile < DelegateClass(File)
def unlink def unlink
# keep this order for thread safeness # keep this order for thread safeness
begin begin
File.unlink(@tmpname) if File.exist?(@tmpname) if File.exist?(@tmpname)
closed? or close
File.unlink(@tmpname)
end
@@cleanlist.delete(@tmpname) @@cleanlist.delete(@tmpname)
@data = @tmpname = nil @data = @tmpname = nil
ObjectSpace.undefine_finalizer(self) ObjectSpace.undefine_finalizer(self)