diff options
author | bentmar <bjorn.bentmar@gmail.com> | 2017-04-28 11:15:09 +0200 |
---|---|---|
committer | Stephane Delcroix <stephane@delcroix.org> | 2017-05-03 10:06:26 +0200 |
commit | 719b4cc3d2963f836cdcea00e7730321a89ffe0a (patch) | |
tree | 803792953833e6a4f8de10d914f885b670a0a909 /Xamarin.Forms.Platform.Android | |
parent | e60363b9df7e96ceeec6b440e7144215dad6c194 (diff) | |
download | xamarin-forms-719b4cc3d2963f836cdcea00e7730321a89ffe0a.tar.gz xamarin-forms-719b4cc3d2963f836cdcea00e7730321a89ffe0a.tar.bz2 xamarin-forms-719b4cc3d2963f836cdcea00e7730321a89ffe0a.zip |
[Android] Add disposed check on FastRenderers.LabelRenderer (#886)
* add disposed check on FastLabelRenderer
Description of Change
Check is the Label is dispodes on GetDesiredSize() on fast LabelRenderer
Bugs Fixed
System.ObjectDisposedException: Cannot access a disposed object.
API Changes
None
Behavioral Changes
None
* Update LabelRenderer.cs
Diffstat (limited to 'Xamarin.Forms.Platform.Android')
-rw-r--r-- | Xamarin.Forms.Platform.Android/FastRenderers/LabelRenderer.cs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Xamarin.Forms.Platform.Android/FastRenderers/LabelRenderer.cs b/Xamarin.Forms.Platform.Android/FastRenderers/LabelRenderer.cs index 7681f54b..aa1f06e0 100644 --- a/Xamarin.Forms.Platform.Android/FastRenderers/LabelRenderer.cs +++ b/Xamarin.Forms.Platform.Android/FastRenderers/LabelRenderer.cs @@ -62,6 +62,11 @@ namespace Xamarin.Forms.Platform.Android.FastRenderers SizeRequest IVisualElementRenderer.GetDesiredSize(int widthConstraint, int heightConstraint) { + if (_disposed) + { + return new SizeRequest(); + } + if (_lastSizeRequest.HasValue) { // if we are measuring the same thing, no need to waste the time @@ -308,4 +313,4 @@ namespace Xamarin.Forms.Platform.Android.FastRenderers _lastSizeRequest = null; } } -}
\ No newline at end of file +} |