diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-09-20 11:23:13 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-09-20 11:23:13 +0000 |
commit | 6a519401176126cd808aa5e3562a21f34a64de65 (patch) | |
tree | 7da966acceedfb11ceb234d796fa0250033fa6b3 /activesupport/lib/active_support | |
parent | 8a35865b747e0e96ae53e45997d6742f8f0ccfc3 (diff) | |
download | rails-6a519401176126cd808aa5e3562a21f34a64de65.tar.gz rails-6a519401176126cd808aa5e3562a21f34a64de65.tar.bz2 rails-6a519401176126cd808aa5e3562a21f34a64de65.zip |
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
Diffstat (limited to 'activesupport/lib/active_support')
-rw-r--r-- | activesupport/lib/active_support/core_ext/object_and_class.rb | 9 |
1 files changed, 0 insertions, 9 deletions
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| |