[iOS] ScrollViewRenderer: clear the renderer (#4489)
authorStephane Delcroix <stephane@delcroix.org>
Wed, 21 Nov 2018 07:31:33 +0000 (08:31 +0100)
committerGitHub <noreply@github.com>
Wed, 21 Nov 2018 07:31:33 +0000 (08:31 +0100)
On Dispose(), the Renderer is supposed to be cleared on the element.
That's taken care of by VisualElementRenderer`1.Dispose().
Unfortunately, ScrollViewRenderer doesn't inherit from it.

I find it strange that this never was triggered before the Shell, but
I'm learning to live surrounded by strange behaviors.

-fixes #4381

Xamarin.Forms.Platform.iOS/Renderers/ScrollViewRenderer.cs

index 31bab55..47281d0 100644 (file)
@@ -160,6 +160,7 @@ namespace Xamarin.Forms.Platform.iOS
                                if (_packager == null)
                                        return;
 
+                               Element?.ClearValue(Platform.RendererProperty);
                                SetElement(null);
 
                                _packager.Dispose();