From a13486997a65320f3abcded92e9edc9433a42a43 Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 23 Mar 2012 03:14:49 +0000 Subject: * 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 --- test/ruby/test_io.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'test/ruby') diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb index 6990de1862..cd4fe98981 100644 --- a/test/ruby/test_io.rb +++ b/test/ruby/test_io.rb @@ -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 -- cgit v1.2.3