diff --git a/actionpack/lib/action_view/template.rb b/actionpack/lib/action_view/template.rb
index <HASH>..<HASH> 100644
--- a/actionpack/lib/action_view/template.rb
+++ b/actionpack/lib/action_view/template.rb
@@ -18,7 +18,7 @@ module ActionView
 
     attr_reader :source, :identifier, :handler, :virtual_path, :formats
 
-    def self.finalizer_for(method_name)
+    Finalizer = proc do |method_name|
       proc do
         ActionView::CompiledTemplates.module_eval do
           remove_possible_method method_name
@@ -77,7 +77,6 @@ module ActionView
     private
       def compile(locals, view)
         method_name = build_method_name(locals)
-
         return method_name if view.respond_to?(method_name)
 
         locals_code = locals.keys.map! { |key| "#{key} = local_assigns[:#{key}];" }.join
@@ -106,7 +105,8 @@ module ActionView
 
         begin
           ActionView::CompiledTemplates.module_eval(source, identifier, line)
-          ObjectSpace.define_finalizer(self, self.class.finalizer_for(method_name))
+          ObjectSpace.define_finalizer(self, Finalizer[method_name])
+
           method_name
         rescue Exception => e # errors from template code
           if logger = (view && view.logger)
Use a constant proc to generate ActionView::Template finalizers. For some strange reason, finalizers created via ActionView::Template.finalizer_for cause Template instances to leak on MRI.