diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-01-17 15:35:09 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-01-17 15:35:09 +0000 |
commit | c474ecb0dfe0dd0d5e6b2b41f09eaf251d0c7079 (patch) | |
tree | 8b595d2ae705de7205f27603da4d452dcab484f1 | |
parent | 46fe9f1d084d09524c338758bd7bb8ddbfe75425 (diff) | |
download | ruby-c474ecb0dfe0dd0d5e6b2b41f09eaf251d0c7079.tar.gz |
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
-rw-r--r-- | lib/drb/drb.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/drb/drb.rb b/lib/drb/drb.rb index d627ec1035..1ed5605007 100644 --- a/lib/drb/drb.rb +++ b/lib/drb/drb.rb @@ -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 |