From 6a519401176126cd808aa5e3562a21f34a64de65 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Tue, 20 Sep 2005 11:23:13 +0000 Subject: Fixed memory leak with Active Record classes when Dependencies.mechanism = :load #1704 [c.r.mcgrath@gmail.com] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2276 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activesupport/lib/active_support/core_ext/object_and_class.rb | 9 --------- 1 file changed, 9 deletions(-) (limited to 'activesupport/lib/active_support') diff --git a/activesupport/lib/active_support/core_ext/object_and_class.rb b/activesupport/lib/active_support/core_ext/object_and_class.rb index 4ad13265d7..cff8fca5bb 100644 --- a/activesupport/lib/active_support/core_ext/object_and_class.rb +++ b/activesupport/lib/active_support/core_ext/object_and_class.rb @@ -1,19 +1,10 @@ class Object #:nodoc: def remove_subclasses_of(*superclasses) subclasses_of(*superclasses).each do |subclass| - subclass.instance_variables.each { |v| subclass.send(:remove_instance_variable, v) } Object.send(:remove_const, subclass.to_s) rescue nil end end - def remove_instance_variables_of(klass) - ObjectSpace.each_object(Class) do |k| - if k.to_s == klass - k.instance_variables.each { |v| k.send(:remove_instance_variable, v) } - end - end - end - def subclasses_of(*superclasses) subclasses = [] ObjectSpace.each_object(Class) do |k| -- cgit v1.2.3