dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.24k stars 1.76k forks source link

[iOS] Navigation.PushModalAsync memory leak #25410

Open nastutusha opened 3 weeks ago

nastutusha commented 3 weeks ago

On iOS MAUI app there is a memory leak when pushing a modal page, when this modal page is popped, the underlying navigation page loses all controls.

Steps to Reproduce

  1. Create Maui app with two pages
  2. Call PushModalAsync(second page)
  3. Call PopModalAsync()
  4. Run iOS simulator or on device

Actual Behaviour:

Page that called a modal page becomes completely blank after pop

Expected Behaviour:

Modal page pushed and popped without a memory leak

I have a sample project with Memory toolkit applied where you can see a page gets leaked after pushing modal page and becomes blank after popping it https://github.com/nastutusha/MauiModalMemoryLeak

Version with bug

I can reproduce it with .NET 8.0.402 and 9.0.100-rc.2.24474.11

Affected platforms

iOS

similar-issues-ai[bot] commented 3 weeks ago

We've found some similar issues:

If any of the above are duplicates, please consider closing this issue out and adding additional context in the original issue.

Note: You can give me feedback by 👍 or 👎 this comment.

nastutusha commented 3 weeks ago

I've seen the similar issues, but none of them neither address nor fix the condition I've described.

MarcosSandoval commented 2 weeks ago

Any news on this guys? Our team is stuck with this issue and it's even worse because there doesn't seem to be any workaround that helps.