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:
parent
91e5ba1cb8
commit
c81863c321
2 changed files with 9 additions and 1 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: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()
|
||||||
|
|
|
@ -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)
|
||||||
|
|
Loading…
Reference in a new issue