diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2004-12-12 20:49:20 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2004-12-12 20:49:20 +0000 |
commit | 1f9243c13e5e91ecbca3628f6c801c06957354e2 (patch) | |
tree | 3f2ee98df30e1885663b30c944ccab139e24beae /railties | |
parent | 65a9011ea3577f19055d653ff6bb16a62ae1a9dd (diff) | |
download | rails-1f9243c13e5e91ecbca3628f6c801c06957354e2.tar.gz rails-1f9243c13e5e91ecbca3628f6c801c06957354e2.tar.bz2 rails-1f9243c13e5e91ecbca3628f6c801c06957354e2.zip |
Cleaner deactivation of the breakpoint server
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@138 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'railties')
-rwxr-xr-x | railties/lib/breakpoint.rb | 10 | ||||
-rw-r--r-- | railties/lib/dispatcher.rb | 2 |
2 files changed, 10 insertions, 2 deletions
diff --git a/railties/lib/breakpoint.rb b/railties/lib/breakpoint.rb index d456c3daa7..9c3164b2eb 100755 --- a/railties/lib/breakpoint.rb +++ b/railties/lib/breakpoint.rb @@ -380,7 +380,7 @@ module Breakpoint @drb_service = DRbService.new
did_collision = false
begin
- DRb.start_service(uri, @drb_service)
+ @service = DRb.start_service(uri, @drb_service)
rescue Errno::EADDRINUSE
if ignore_collisions then
nil
@@ -402,6 +402,14 @@ module Breakpoint return true
end
+ # Deactivates a running Breakpoint service.
+ def deactivate_drb
+ @service.stop_service unless @service.nil?
+ @service = nil
+ @use_drb = false
+ @drb_service = nil
+ end
+
# Returns true when Breakpoints are used over DRb.
# Breakpoint.activate_drb causes this to be true.
def use_drb?
diff --git a/railties/lib/dispatcher.rb b/railties/lib/dispatcher.rb index d30353dc7b..abb686a469 100644 --- a/railties/lib/dispatcher.rb +++ b/railties/lib/dispatcher.rb @@ -49,7 +49,7 @@ class Dispatcher ActiveRecord::Base.reset_column_information_and_inheritable_attributes_for_all_subclasses end - DRb.stop_service if defined?(BREAKPOINT_SERVER_PORT) + Breakpoint.deactivate_drb if defined?(BREAKPOINT_SERVER_PORT) end end |