Description
When clearing Shell.Current.Items and navigating to a new root page:
- iOS: The page's handler is disconnected, but the handlers on child elements (Label, Entry, Button, etc.) within that page are not disconnected. This means native platform views remain allocated and are never cleaned up, causing a memory/resource leak.
- Android: Neither the page's handler nor the handlers on child elements are disconnected, causing both the native Android views and the managed page object tree to leak.

Steps to Reproduce
- Create a Shell app with a root page containing child elements (Label, Entry, etc.)
- Clear
Shell.Current.Items, add a new TabBar with a different root page, and navigate to it:
var tabBar = new TabBar { Route = "root1" };
tabBar.Items.Add(new Tab
{
Items =
{
new ShellContent
{
ContentTemplate = new DataTemplate(() => new SecondRootPage())
}
}
});
Shell.Current.Items.Clear();
Shell.Current.Items.Add(tabBar);
await Shell.Current.GoToAsync("//root1", true);
- Check the
Handler property on the child elements of the original page and the page handler.
Link to public reproduction project repository
https://github.com/Vetle444/MauiTestApp/tree/shellItemsClearHandlerLeak
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
Affected platform versions
No response
Did you find any workaround?
No response
Relevant log output
Description
When clearing
Shell.Current.Itemsand navigating to a new root page:Steps to Reproduce
Shell.Current.Items, add a newTabBarwith a different root page, and navigate to it:Handlerproperty on the child elements of the original page and the page handler.Link to public reproduction project repository
https://github.com/Vetle444/MauiTestApp/tree/shellItemsClearHandlerLeak
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
Affected platform versions
No response
Did you find any workaround?
No response
Relevant log output