Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Cleaner deactivation of the breakpoint server

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@138 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
commit 1f9243c13e5e91ecbca3628f6c801c06957354e2 1 parent 65a9011
@dhh dhh authored
Showing with 10 additions and 2 deletions.
  1. +9 −1 railties/lib/breakpoint.rb
  2. +1 −1  railties/lib/dispatcher.rb
View
10 railties/lib/breakpoint.rb
@@ -380,7 +380,7 @@ def activate_drb(uri = nil, allowed_hosts = ['localhost', '127.0.0.1', '::1'],
@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 @@ def activate_drb(uri = nil, allowed_hosts = ['localhost', '127.0.0.1', '::1'],
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?
View
2  railties/lib/dispatcher.rb
@@ -49,7 +49,7 @@ def self.dispatch(cgi = CGI.new, session_options = DEFAULT_SESSION_OPTIONS)
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
Please sign in to comment.
Something went wrong with that request. Please try again.