-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Open
Labels
t/bugSomething isn't workingSomething isn't working
Description
Description
When changing the Detail (= setting another page) of a FlyoutPage programmatically, the previous Detail ain't cleaned up. This causes memoryleaks and a slow and crashing app after browsing to pages.
Relevant code:
if (Application.Current.Windows[0].Page is FlyoutPage flyoutPage)
flyoutPage.Detail = new NavigationPage(new DetailPage2());
No leaks when not using a new NavigationPage (but no workaround for my app, since i need the "hamburger menu"
if (Application.Current.Windows[0].Page is FlyoutPage flyoutPage)
flyoutPage.Detail = new DetailPage2();
Steps to Reproduce
- Run the App on an android device
- In DetailPage1 click the button to navigate to DetailPage2
- Wait a few seconds and the nuget package from https://github.com/AdamEssenmacher/MemoryToolkit.Maui "displays" all the leaks from DetailPage1 in an Alert popup
- In DetailPage2 click the button to navigate to DetailPage1
- Wait a few seconds and the nuget package from https://github.com/AdamEssenmacher/MemoryToolkit.Maui "displays" all the leaks from DetailPage1 in an Alert popup
Link to public reproduction project repository
https://github.com/3sRykaert/MauiMemoryleak/tree/FlyoutpageIssue (make sure to use branch FlyoutpageIssue)
Version with bug
10.0.40
Is this a regression from previous behavior?
Yes, this used to work in Xamarin.Forms
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
Android 11 and up (didn't test on other platforms)
Did you find any workaround?
No
Relevant log output
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
t/bugSomething isn't workingSomething isn't working