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 --- .../test/core_ext/object_and_class_ext_test.rb | 46 ---------------------- 1 file changed, 46 deletions(-) (limited to 'activesupport/test') diff --git a/activesupport/test/core_ext/object_and_class_ext_test.rb b/activesupport/test/core_ext/object_and_class_ext_test.rb index 29b2f2fc8b..29e18d5ae1 100644 --- a/activesupport/test/core_ext/object_and_class_ext_test.rb +++ b/activesupport/test/core_ext/object_and_class_ext_test.rb @@ -5,27 +5,6 @@ class ClassA; end class ClassB < ClassA; end class ClassC < ClassB; end class ClassD < ClassA; end -class RemoveSubsTestClass; end -class RemoveSubsBaseClass - def self.add_ivar - @ivar = RemoveSubsTestClass.new - end -end -class RemoveSubsSubClass < RemoveSubsBaseClass; end -class RemoveSubsTestClass2; end -class RemoveSubsBaseClass2 - def self.add_ivar - @ivar = RemoveSubsTestClass2.new - end -end -class RemoveSubsSubClass2 < RemoveSubsBaseClass2; end -class RemoveSubsTestClass3; end -class RemoveSubsBaseClass3 - def self.add_ivar - @ivar = RemoveSubsTestClass3.new - end -end -class RemoveSubsSubClass3 < RemoveSubsBaseClass3; end class ClassExtTest < Test::Unit::TestCase def test_methods @@ -51,29 +30,4 @@ class ObjectTests < Test::Unit::TestCase suppress(LoadError, ArgumentError) { raise LoadError } suppress(LoadError, ArgumentError) { raise ArgumentError } end - - def test_remove_subclasses_of_unsets_ivars - r = RemoveSubsSubClass.new - RemoveSubsSubClass.add_ivar - RemoveSubsBaseClass.remove_subclasses - - GC.start - ObjectSpace.each_object do |o| - flunk("ObjectSpace still contains RemoveSubsTestClass") if o.class == RemoveSubsTestClass - end - end - - def test_remove_subclasses_of_multiple_classes_unsets_ivars - r2 = RemoveSubsSubClass2.new - RemoveSubsSubClass2.add_ivar - r3 = RemoveSubsSubClass3.new - RemoveSubsSubClass3.add_ivar - - Object.remove_subclasses_of(RemoveSubsBaseClass2, RemoveSubsBaseClass3) - - GC.start - ObjectSpace.each_object do |o| - flunk("ObjectSpace still contains RemoveSubsTestClass") if o.class == RemoveSubsTestClass - end - end end -- cgit v1.2.3