Skip to content

Commit

Permalink
[Android] Add missing unsubscribe on activity destroy (xamarin#13023)
Browse files Browse the repository at this point in the history
When the activity is destroyed an event remain attached, if the application is a singleton this cause a memory leak of the activity.
  • Loading branch information
kvpt authored and pictos committed Dec 29, 2020
1 parent 1e65d71 commit 64a78d7
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,10 @@ protected override void OnDestroy()
PreviousActivityDestroying.Reset();

if (_application != null)
{
_application.PropertyChanging -= AppOnPropertyChanging;
_application.PropertyChanged -= AppOnPropertyChanged;
}

PopupManager.Unsubscribe(this);

Expand Down

0 comments on commit 64a78d7

Please sign in to comment.