From ce31eae3ee40faa1def3830bb3477d88283eae95 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Thu, 7 Jul 2005 06:39:13 +0000 Subject: 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 --- activesupport/CHANGELOG | 5 +++++ .../lib/active_support/core_ext/object_and_class.rb | 14 +++++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) (limited to 'activesupport') diff --git a/activesupport/CHANGELOG b/activesupport/CHANGELOG index 3d93b561b4..b72d2fd5ed 100644 --- a/activesupport/CHANGELOG +++ b/activesupport/CHANGELOG @@ -1,5 +1,10 @@ *SVN* +* 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. + + +*1.1.0* + * Fixed conflict with Glue gem #1606 [Rick Olson] * Added new rules to the Inflector to deal with more unusual plurals mouse/louse => mice/lice, information => information, ox => oxen, virus => viri, archive => archives #1571, #1583, #1490, #1599, #1608 [foamdino@gmail.com/others] 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 = [] -- cgit v1.2.3