diff options
author | Jimmy Garrido <jimmygarrido@outlook.com> | 2017-06-13 12:11:10 -0700 |
---|---|---|
committer | Rui Marinho <me@ruimarinho.net> | 2017-06-13 20:11:10 +0100 |
commit | 88693cc316df3ffaeca4871362d2639504258989 (patch) | |
tree | bec05e58949d84df7b7c1c1fbaf189ab42a902c4 /Xamarin.Forms.Platform.iOS | |
parent | 9a7b97de54df283fa0a42ed56c5af02becf5016d (diff) | |
download | xamarin-forms-88693cc316df3ffaeca4871362d2639504258989.tar.gz xamarin-forms-88693cc316df3ffaeca4871362d2639504258989.tar.bz2 xamarin-forms-88693cc316df3ffaeca4871362d2639504258989.zip |
Fix possible crash on iOS when using ContextActions (#973)
Diffstat (limited to 'Xamarin.Forms.Platform.iOS')
-rw-r--r-- | Xamarin.Forms.Platform.iOS/ContextActionCell.cs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Xamarin.Forms.Platform.iOS/ContextActionCell.cs b/Xamarin.Forms.Platform.iOS/ContextActionCell.cs index 1b19e9b2..4ff7f87c 100644 --- a/Xamarin.Forms.Platform.iOS/ContextActionCell.cs +++ b/Xamarin.Forms.Platform.iOS/ContextActionCell.cs @@ -274,6 +274,11 @@ namespace Xamarin.Forms.Platform.iOS for (var i = 0; i < _buttons.Count; i++) _buttons[i].Dispose(); + var handler = new PropertyChangedEventHandler(OnMenuItemPropertyChanged); + + foreach (var item in _menuItems) + item.PropertyChanged -= handler; + _buttons.Clear(); _menuItems.Clear(); |