summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.Android/Cells/BaseCellView.cs
diff options
context:
space:
mode:
authorE.Z. Hart <hartez@users.noreply.github.com>2016-08-30 11:57:55 -0600
committerJason Smith <jason.smith@xamarin.com>2016-08-30 10:57:55 -0700
commit974705b9a920e71ecaa9f5e0d58cf6d80a1d71cf (patch)
treecaa8ac25f603ee796f455846e615011afb9b702a /Xamarin.Forms.Platform.Android/Cells/BaseCellView.cs
parenta0dae2d111a5fc59a272f5b8a27885a54dcf6f32 (diff)
downloadxamarin-forms-974705b9a920e71ecaa9f5e0d58cf6d80a1d71cf.tar.gz
xamarin-forms-974705b9a920e71ecaa9f5e0d58cf6d80a1d71cf.tar.bz2
xamarin-forms-974705b9a920e71ecaa9f5e0d58cf6d80a1d71cf.zip
Fix memory leak caused by BaseCellView and RendererHolder (#311)
Diffstat (limited to 'Xamarin.Forms.Platform.Android/Cells/BaseCellView.cs')
-rw-r--r--Xamarin.Forms.Platform.Android/Cells/BaseCellView.cs8
1 files changed, 7 insertions, 1 deletions
diff --git a/Xamarin.Forms.Platform.Android/Cells/BaseCellView.cs b/Xamarin.Forms.Platform.Android/Cells/BaseCellView.cs
index 74c56dbd..c4d10cc4 100644
--- a/Xamarin.Forms.Platform.Android/Cells/BaseCellView.cs
+++ b/Xamarin.Forms.Platform.Android/Cells/BaseCellView.cs
@@ -18,7 +18,7 @@ namespace Xamarin.Forms.Platform.Android
public const double DefaultMinHeight = 44;
readonly Color _androidDefaultTextColor;
- readonly Cell _cell;
+ Cell _cell;
readonly TextView _detailText;
readonly ImageView _imageView;
readonly TextView _mainText;
@@ -179,6 +179,12 @@ namespace Xamarin.Forms.Platform.Android
LayoutParameters = new LayoutParams(ViewGroup.LayoutParams.MatchParent, (int)(height == -1 ? ViewGroup.LayoutParams.WrapContent : height));
}
+ protected override void OnDetachedFromWindow()
+ {
+ base.OnDetachedFromWindow();
+ _cell = null;
+ }
+
async void UpdateBitmap(ImageSource source, ImageSource previousSource = null)
{
if (Equals(source, previousSource))