mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* test/ruby/test_io.rb (try_fdopen): more GCable.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35119 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
2bf3b20dbe
commit
a13486997a
1 changed files with 5 additions and 3 deletions
|
@ -1457,9 +1457,11 @@ class TestIO < Test::Unit::TestCase
|
|||
|
||||
def try_fdopen(fd, autoclose = true, level = 100)
|
||||
if level > 0
|
||||
f = try_fdopen(fd, autoclose, level - 1)
|
||||
GC.start
|
||||
f
|
||||
begin
|
||||
1.times {return try_fdopen(fd, autoclose, level - 1)}
|
||||
ensure
|
||||
GC.start
|
||||
end
|
||||
else
|
||||
WeakRef.new(IO.for_fd(fd, autoclose: autoclose))
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue