uno.extensions icon indicating copy to clipboard operation
uno.extensions copied to clipboard

[Navigation] ViewModels created by the Navigator are not disposed

Open Nurgo opened this issue 2 years ago • 2 comments
trafficstars

Hi, I'm using Uno Platform with Uno Extensions for ViewModel navigation. I've noticed that when navigating away, the previous ViewModel isn't automatically disposed, potentially leaving resources unmanaged.

If a class implements IDisposable, it it the responsibility of the owner to Dispose instances of the class.

Originally posted by @Nurgo in https://github.com/unoplatform/uno.extensions/discussions/1602

Nurgo avatar Oct 06 '23 17:10 Nurgo

I don't understand why this problem is marked as "priority/awaiting-more-evidence", it's a major problem. Each time you navigate to a new ViewModel, the previous one is not disposed, takes memory, and continues to receive events. This makes the application slower and slower, ending in a crash.

Nurgo avatar Jan 26 '24 13:01 Nurgo

@nickrandolph maybe @eriklimakc can help take a look at this one ? (as he will be helping with the navigation documentation)

agneszitte avatar May 24 '24 14:05 agneszitte