1
0
Fork 0
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:
nobu 2012-03-23 03:14:49 +00:00
parent 2bf3b20dbe
commit a13486997a

View file

@ -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