diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-12-25 05:54:27 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-12-25 05:54:27 +0000 |
commit | efee0c87c1c6a71fcacabb08205ad6a83d438955 (patch) | |
tree | a46a091a1cacce0c17b607dbf261e5e702cd1c46 | |
parent | 2c74fe1106db5ef2a63d6c2b3d527847c0994b2a (diff) |
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
-rw-r--r-- | lib/rubygems/command.rb | 10 |
1 files changed, 9 insertions, 1 deletions
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 ## |