* 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
@ -1457,9 +1457,11 @@ class TestIO < Test::Unit::TestCase
|
|||||||
|
|
||||||
def try_fdopen(fd, autoclose = true, level = 100)
|
def try_fdopen(fd, autoclose = true, level = 100)
|
||||||
if level > 0
|
if level > 0
|
||||||
f = try_fdopen(fd, autoclose, level - 1)
|
begin
|
||||||
GC.start
|
1.times {return try_fdopen(fd, autoclose, level - 1)}
|
||||||
f
|
ensure
|
||||||
|
GC.start
|
||||||
|
end
|
||||||
else
|
else
|
||||||
WeakRef.new(IO.for_fd(fd, autoclose: autoclose))
|
WeakRef.new(IO.for_fd(fd, autoclose: autoclose))
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user