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
This commit is contained in:
Nicholas Seckar
2006-11-17 22:29:02 +00:00
parent 44e6aa7e19
commit f92d6a07d0
2 changed files with 7 additions and 1 deletions

View File

@@ -1,5 +1,7 @@
*SVN*
* Reuse named route helper module between Routing reloads. Use remove_method to delete named route methods after each load. Since the module is never collected, this fixes a significant memory leak. [Nicholas Seckar]
* ActionView::Base.erb_variable accessor names the buffer variable used to render templates. Defaults to _erbout; use _buf for erubis. [Rick Olson]
* assert_select_rjs :remove. [Dylan Egan]

View File

@@ -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)