diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-03-23 03:14:49 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-03-23 03:14:49 +0000 |
commit | a13486997a65320f3abcded92e9edc9433a42a43 (patch) | |
tree | 5d1ab5fee957c13251f2d395eb0d53c0a94f134f /test | |
parent | 2bf3b20dbe58b8a67adec3e6dd51c00040d496ca (diff) | |
download | ruby-a13486997a65320f3abcded92e9edc9433a42a43.tar.gz |
* 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
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_io.rb | 8 |
1 files changed, 5 insertions, 3 deletions
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 |