diff options
Diffstat (limited to 'Xamarin.Forms.Platform.iOS/Cells/ViewCellRenderer.cs')
-rw-r--r-- | Xamarin.Forms.Platform.iOS/Cells/ViewCellRenderer.cs | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/Xamarin.Forms.Platform.iOS/Cells/ViewCellRenderer.cs b/Xamarin.Forms.Platform.iOS/Cells/ViewCellRenderer.cs index 8f8a92ce..30c17234 100644 --- a/Xamarin.Forms.Platform.iOS/Cells/ViewCellRenderer.cs +++ b/Xamarin.Forms.Platform.iOS/Cells/ViewCellRenderer.cs @@ -48,9 +48,12 @@ namespace Xamarin.Forms.Platform.iOS internal class ViewTableCell : UITableViewCell, INativeElementView { WeakReference<IVisualElementRenderer> _rendererRef; - ViewCell _viewCell; + Element INativeElementView.Element => ViewCell; + internal bool SupressSeparator { get; set; } + bool _disposed; + public ViewTableCell(string key) : base(UITableViewCellStyle.Default, key) { } @@ -66,10 +69,6 @@ namespace Xamarin.Forms.Platform.iOS } } - Element INativeElementView.Element => ViewCell; - - internal bool SupressSeparator { get; set; } - public override void LayoutSubviews() { //This sets the content views frame. @@ -115,6 +114,9 @@ namespace Xamarin.Forms.Platform.iOS protected override void Dispose(bool disposing) { + if (_disposed) + return; + if (disposing) { IVisualElementRenderer renderer; @@ -126,8 +128,12 @@ namespace Xamarin.Forms.Platform.iOS _rendererRef = null; } + + _viewCell = null; } + _disposed = true; + base.Dispose(disposing); } |