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 | 21166391d5685a2bda2861203cf28560e1a0353d (patch) | |
tree | a46a091a1cacce0c17b607dbf261e5e702cd1c46 /lib/rubygems | |
parent | 34a5fe089ee2e437f7cdaab7514a7b3b64802971 (diff) | |
download | ruby-21166391d5685a2bda2861203cf28560e1a0353d.tar.gz |
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
Diffstat (limited to 'lib/rubygems')
-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 ## |