Skip to content

Modal with NavigationPage creates memory leaks #34470

@Pastajello

Description

@Pastajello

Description

Hello.

I've noticed a memory leak when user uses NavigationPage to open a modal with another NavigationPage like so:
Navigation.PushModalAsync(new NavigationPage(new MainPage()));

When we open a modal without NavigationPage there is no leakage.

I'm using AdamE.MemoryToolkit.Maui for leak detection.

IOS and Android differ slightly, Android show leaks on navigating back, iOS on navigating forward.
Image

Steps to Reproduce

  1. Open project from repo: https://github.com/Pastajello/Leak_NavigationPage
  2. Run the app in Debug
  3. Tap the button "Navigate": On iOS: see that leaks appear
  4. Tap button "Back" : On Android see that leak appear

Link to public reproduction project repository

https://github.com/Pastajello/Leak_NavigationPage

Version with bug

10.0.50

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

No response

Affected platforms

iOS, Android, I was not able test on other platforms

Affected platform versions

No response

Did you find any workaround?

No response

Relevant log output

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions