From 7538350f6d750f5e29d011834cf36a17a1e045e3 Mon Sep 17 00:00:00 2001 From: "E.Z. Hart" Date: Wed, 22 Mar 2017 04:40:15 -0600 Subject: Add gesture disposed check to FrameRenderer (#829) --- Xamarin.Forms.Platform.Android/AppCompat/FrameRenderer.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Xamarin.Forms.Platform.Android/AppCompat/FrameRenderer.cs b/Xamarin.Forms.Platform.Android/AppCompat/FrameRenderer.cs index 6954654b..7c40ea80 100644 --- a/Xamarin.Forms.Platform.Android/AppCompat/FrameRenderer.cs +++ b/Xamarin.Forms.Platform.Android/AppCompat/FrameRenderer.cs @@ -83,6 +83,13 @@ namespace Xamarin.Forms.Platform.Android.AppCompat ScaleGestureDetectorCompat.SetQuickScaleEnabled(_scaleDetector.Value, true); handled = _scaleDetector.Value.OnTouchEvent(e); } + + if (_gestureDetector.IsValueCreated && _gestureDetector.Value.Handle == IntPtr.Zero) + { + // This gesture detector has already been disposed, probably because it's on a cell which is going away + return handled; + } + return _gestureDetector.Value.OnTouchEvent(e) || handled; } -- cgit v1.2.3