diff options
author | adrianknight89 <adrianknight89@outlook.com> | 2016-11-15 16:35:24 -0600 |
---|---|---|
committer | E.Z. Hart <hartez@users.noreply.github.com> | 2016-11-15 15:35:24 -0700 |
commit | ffab780c2acd9ef49268d731e14b11b5fdbc3293 (patch) | |
tree | eb3ff3b5ef080bcab528e0cccd4ed37c4527f4e9 /Xamarin.Forms.Platform.Android | |
parent | 0ccae8a3af5f2617fe621562fbbdaac3df7e7b31 (diff) | |
download | xamarin-forms-ffab780c2acd9ef49268d731e14b11b5fdbc3293.tar.gz xamarin-forms-ffab780c2acd9ef49268d731e14b11b5fdbc3293.tar.bz2 xamarin-forms-ffab780c2acd9ef49268d731e14b11b5fdbc3293.zip |
fix MasterDetailPage dispose (#505)
Diffstat (limited to 'Xamarin.Forms.Platform.Android')
-rw-r--r-- | Xamarin.Forms.Platform.Android/AppCompat/FormsAppCompatActivity.cs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/Xamarin.Forms.Platform.Android/AppCompat/FormsAppCompatActivity.cs b/Xamarin.Forms.Platform.Android/AppCompat/FormsAppCompatActivity.cs index 35ddf2da..2fe5d5d9 100644 --- a/Xamarin.Forms.Platform.Android/AppCompat/FormsAppCompatActivity.cs +++ b/Xamarin.Forms.Platform.Android/AppCompat/FormsAppCompatActivity.cs @@ -185,15 +185,14 @@ namespace Xamarin.Forms.Platform.Android protected override void OnDestroy() { - // may never be called - base.OnDestroy(); - MessagingCenter.Unsubscribe<Page, AlertArguments>(this, Page.AlertSignalName); MessagingCenter.Unsubscribe<Page, bool>(this, Page.BusySetSignalName); MessagingCenter.Unsubscribe<Page, ActionSheetArguments>(this, Page.ActionSheetSignalName); - if (_platform != null) - _platform.Dispose(); + _platform?.Dispose(); + + // call at the end to avoid race conditions with Platform dispose + base.OnDestroy(); } protected override void OnNewIntent(Intent intent) |