From f92d6a07d0d01226fb80c82608d332843c01f2d6 Mon Sep 17 00:00:00 2001 From: Nicholas Seckar Date: Fri, 17 Nov 2006 22:29:02 +0000 Subject: Reuse named route helper module between Routing reloads to prevent memory leaks. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5548 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/lib/action_controller/routing.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'actionpack/lib/action_controller/routing.rb') diff --git a/actionpack/lib/action_controller/routing.rb b/actionpack/lib/action_controller/routing.rb index 35eec734d3..3c53acc164 100644 --- a/actionpack/lib/action_controller/routing.rb +++ b/actionpack/lib/action_controller/routing.rb @@ -996,7 +996,11 @@ module ActionController def clear! @routes = {} @helpers = [] - @module = Module.new + + @module ||= Module.new + @module.instance_methods.each do |selector| + @module.send :remove_method, selector + end end def add(name, route) -- cgit v1.2.3