Skip to content

Leaking pages on navigation #19677

Open
Open
@c-ramarin

Description

@c-ramarin

Current behavior

On Android device/emulator, when navigating HomePage -> Page1 and then back to HomePage, then calling GC.Collect (called automatically by HomePage), a reference remains to Page1

Expected behavior

When navigating HomePage -> Page1 and then back to HomePage, then calling GC.Collect, there should be no reference to Page1 and all it's related resources released

How to reproduce it (as minimally and precisely as possible)

UnoAppTest.zip

1- Run app on Android device or emulator in debug mode.
2- Watch the output window in your IDE, notice the Inactive/active DependencyObject references counts
3- navigate to page 1, then page 2, then page 3
4- navigate back to the home page (trigger GC.Collect)
5- notice the IDE output window
6- Reference count = 1 remains for most visited pages (search Page1, Page2, Page3)

Image

Workaround

No response

Works on UWP/WinUI

None

Environment

No response

NuGet package version(s)

No response

Affected platforms

Android

IDE

No response

IDE version

No response

Relevant plugins

No response

Anything else we need to know?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    difficulty/tbdCategorizes an issue for which the difficulty level needs to be defined.kind/bugSomething isn't workingtriage/untriagedIndicates an issue requires triaging or verification

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions