From e1734092bec06d5e013144f13c947c040586cec8 Mon Sep 17 00:00:00 2001 From: "E.Z. Hart" Date: Tue, 16 May 2017 11:27:41 -0600 Subject: Remove VisualElement finalizer (#918) * [Controls] Add repo for bugzilla 55365 * Remove finalizer from VisualElement * Remove unused using directive * Removing test for 44074 * Update docs --- Xamarin.Forms.Core.UnitTests/BehaviorTest.cs | 37 ---------------------------- 1 file changed, 37 deletions(-) (limited to 'Xamarin.Forms.Core.UnitTests') diff --git a/Xamarin.Forms.Core.UnitTests/BehaviorTest.cs b/Xamarin.Forms.Core.UnitTests/BehaviorTest.cs index 90217389..464f9731 100644 --- a/Xamarin.Forms.Core.UnitTests/BehaviorTest.cs +++ b/Xamarin.Forms.Core.UnitTests/BehaviorTest.cs @@ -109,42 +109,5 @@ namespace Xamarin.Forms.Core.UnitTests collection.Remove (behavior); Assert.Null (behavior.AssociatedObject); } - - [Test] - //https://bugzilla.xamarin.com/show_bug.cgi?id=44074 - public void TestBehaviorsAreDetachedBeforeGarbageCollection() - { - WeakReference weakBindable = null; - - var attachCount = MockBehavior.AttachCount; - - int i = 0; - Action create = null; - create = () => - { - if (i++ < 1024) - { - create(); - return; - } - - var bindable = new MockBindable - { - Behaviors = { - new MockBehavior () - } - }; - weakBindable = new WeakReference(bindable); - }; - - create(); - - GC.Collect(); - GC.WaitForPendingFinalizers(); - GC.Collect(); - - Assert.False(weakBindable.IsAlive); - Assert.AreEqual(attachCount, MockBehavior.AttachCount); - } } } \ No newline at end of file -- cgit v1.2.3