Skip to content
This repository was archived by the owner on May 1, 2024. It is now read-only.

Commit 3fdffc0

Browse files
authored
[Android] Add missing unsubscribe on activity destroy (#13023)
When the activity is destroyed an event remain attached, if the application is a singleton this cause a memory leak of the activity.
1 parent 3ad4122 commit 3fdffc0

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Xamarin.Forms.Platform.Android/AppCompat/FormsAppCompatActivity.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,10 @@ protected override void OnDestroy()
327327
PreviousActivityDestroying.Reset();
328328

329329
if (_application != null)
330+
{
331+
_application.PropertyChanging -= AppOnPropertyChanging;
330332
_application.PropertyChanged -= AppOnPropertyChanged;
333+
}
331334

332335
PopupManager.Unsubscribe(this);
333336

0 commit comments

Comments
 (0)