mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/tempfile.rb (Tempfile#close!): should not undefine finalizer
by just unlink. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24666 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
c6defbf310
commit
ffd0da0333
2 changed files with 6 additions and 1 deletions
|
@ -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>
|
Wed Aug 26 17:00:31 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* tool/mkconfig.rb (program_transform_name): fix for autoconf 2.61
|
* tool/mkconfig.rb (program_transform_name): fix for autoconf 2.61
|
||||||
|
|
|
@ -126,6 +126,7 @@ class Tempfile < DelegateClass(File)
|
||||||
def close!
|
def close!
|
||||||
_close
|
_close
|
||||||
unlink
|
unlink
|
||||||
|
ObjectSpace.undefine_finalizer(self)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Unlinks the file. On UNIX-like systems, it is often a good idea
|
# 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
|
# remove tmpname and cleanlist from callback
|
||||||
@data[0] = @data[2] = nil
|
@data[0] = @data[2] = nil
|
||||||
@data = @tmpname = nil
|
@data = @tmpname = nil
|
||||||
ObjectSpace.undefine_finalizer(self)
|
|
||||||
rescue Errno::EACCES
|
rescue Errno::EACCES
|
||||||
# may not be able to unlink on Windows; just ignore
|
# may not be able to unlink on Windows; just ignore
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue