diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-07-07 06:39:13 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-07-07 06:39:13 +0000 |
commit | ce31eae3ee40faa1def3830bb3477d88283eae95 (patch) | |
tree | c94f741c834d2853e27f41f9151b47f0c0feec7a /activesupport/lib | |
parent | f8be47a6a3088440f71b2995c1402020d9df13d3 (diff) | |
download | rails-ce31eae3ee40faa1def3830bb3477d88283eae95.tar.gz rails-ce31eae3ee40faa1def3830bb3477d88283eae95.tar.bz2 rails-ce31eae3ee40faa1def3830bb3477d88283eae95.zip |
Remove fix against memory leaks in development mode as it killed development performance on large applications (2-3s stall on Basecamp). Octopod is working on a better fix.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1752 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/core_ext/object_and_class.rb | 14 |
1 files changed, 9 insertions, 5 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 968c3bdeac..bd67b3d1fa 100644 --- a/activesupport/lib/active_support/core_ext/object_and_class.rb +++ b/activesupport/lib/active_support/core_ext/object_and_class.rb @@ -1,14 +1,18 @@ class Object #:nodoc: def remove_subclasses_of(superclass) subclasses_of(superclass).each do |subclass| - ObjectSpace.each_object(Class) do |k| - if k.to_s == subclass - k.instance_variables.each { |v| k.send(:remove_instance_variable, v) } - end - end + # remove_instance_variables_of(klass) Object.send(:remove_const, subclass) 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(superclass) subclasses = [] |