Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,10 @@ public override void OnDestroyView()
{
base.OnDestroyView();
((IShellContentController)ShellContentTab).RecyclePage(_page);
// Recursively disconnect handlers on the page and its child elements
// to prevent memory leaks when Shell items are cleared
_page?.DisconnectHandlers();
// Only disconnect when ShellContent is removed from the Shell hierarchy (e.g. Shell.Items.Clear()).
// During normal navigation the page is still cached and will be reused.
if (ShellContentTab?.FindParentOfType<Shell>() == null)
_page?.DisconnectHandlers();
_page = null;
}
}
Expand Down
Loading