From efee0c87c1c6a71fcacabb08205ad6a83d438955 Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 25 Dec 2017 05:54:27 +0000 Subject: fix leaked fds * lib/rubygems/command.rb (Gem::Command#invoke_with_build_args): restore UI and close the created SilentUI. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61465 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/rubygems/command.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'lib/rubygems') diff --git a/lib/rubygems/command.rb b/lib/rubygems/command.rb index 3bdca656b3..a7ec212e51 100644 --- a/lib/rubygems/command.rb +++ b/lib/rubygems/command.rb @@ -300,7 +300,10 @@ class Gem::Command options[:build_args] = build_args - self.ui = Gem::SilentUI.new if options[:silent] + if options[:silent] + old_ui = self.ui + self.ui = ui = Gem::SilentUI.new + end if options[:help] then show_help @@ -309,6 +312,11 @@ class Gem::Command else execute end + ensure + if ui + self.ui = old_ui + ui.close + end end ## -- cgit v1.2.3