Skip to content

Commit

Permalink
* test/ruby/test_io.rb (try_fdopen): more GCable.
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35119 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
nobu committed Mar 23, 2012
1 parent 2bf3b20 commit a134869
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions test/ruby/test_io.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1457,9 +1457,11 @@ def test_sysopen

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
Expand Down

0 comments on commit a134869

Please sign in to comment.