-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Android] Modal page wrapped in NavigationPage is not garbage collected after PopModalAsync #34456
Copy link
Copy link
Open
Labels
area-navigationNavigationPageNavigationPagei/regressionThis issue described a confirmed regression on a currently supported versionThis issue described a confirmed regression on a currently supported versionplatform/androidregressed-in-10-preview1s/triagedIssue has been reviewedIssue has been revieweds/verifiedVerified / Reproducible Issue ready for Engineering TriageVerified / Reproducible Issue ready for Engineering Triaget/bugSomething isn't workingSomething isn't working
Milestone
Description
Description
When a ContentPage is pushed as a modal wrapped in a NavigationPage via Navigation.PushModalAsync(new NavigationPage(page)), neither the NavigationPage, the inner ContentPage, nor any of their child views are garbage collected after calling PopModalAsync.
A plain modal page (without NavigationPage wrapping) is collected correctly.
This works correctly on iOS.
Steps to Reproduce
- Clone https://github.com/Vetle444/MauiTestApp/tree/modalMemoryLeak
- Tap
ModalPageNotCleanedUp - Tap
Push Modal Page in NavigationPage - Close it
- Tap
Force GC & Check Cleanup - Notice that everything is still alive
Link to public reproduction project repository
https://github.com/Vetle444/MauiTestApp/tree/modalMemoryLeak
Version with bug
10.0.50
Is this a regression from previous behavior?
Yes, this used to work in .NET MAUI
Last version that worked well
9.0.100 SR10
Affected platforms
Android
Affected platform versions
No response
Did you find any workaround?
Check PR in DIPS.Mobile.UI for workaround: DIPSAS/DIPS.Mobile.UI#818, specifically StackNavigationManagerWorkaround class
Relevant log output
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area-navigationNavigationPageNavigationPagei/regressionThis issue described a confirmed regression on a currently supported versionThis issue described a confirmed regression on a currently supported versionplatform/androidregressed-in-10-preview1s/triagedIssue has been reviewedIssue has been revieweds/verifiedVerified / Reproducible Issue ready for Engineering TriageVerified / Reproducible Issue ready for Engineering Triaget/bugSomething isn't workingSomething isn't working
