diff --git a/CHANGELOG.md b/CHANGELOG.md index 2a6e37d..5f6296b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ (Adam Prescott) [Issue #493] * Ensure process exits with correct status code and $! is propagated. (Micah Geisel) [Issue #497] +* Close dup'ed fd after using (Dmitry Vorotilin) [Issue #446, #529, #528] ### 1.5.0 ### diff --git a/lib/capybara/poltergeist/client.rb b/lib/capybara/poltergeist/client.rb index 5fa6688..38357b2 100644 --- a/lib/capybara/poltergeist/client.rb +++ b/lib/capybara/poltergeist/client.rb @@ -99,13 +99,13 @@ module Capybara::Poltergeist # it works with JRuby but I've experienced strange mistakes on Rubinius. def redirect_stdout prev = STDOUT.dup - prev.autoclose = false $stdout = @write_io STDOUT.reopen(@write_io) yield ensure STDOUT.reopen(prev) $stdout = STDOUT + prev.close end def kill_phantomjs