drb.rb: stop all handlers to fix thread leaks

* lib/drb/drb.rb (stop_service): stop all handler threads started
  in main_loop.  fix thread leaks.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49310 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2015-01-17 15:35:09 +00:00
parent 46fe9f1d08
commit c474ecb0df
1 changed files with 3 additions and 2 deletions

View File

@ -1467,12 +1467,13 @@ module DRb
if Thread.current['DRb'] && Thread.current['DRb']['server'] == self
Thread.current['DRb']['stop_service'] = true
else
threads = [@thread, *@grp.list]
if @protocol.respond_to? :shutdown
@protocol.shutdown
else
@thread.kill # xxx: Thread#kill
threads.each {|thread| thread.kill} # xxx: Thread#kill
end
@thread.join
threads.each {|thread| thread.join}
end
end