Description
Description
This problem can be illustrated with a test such as:
main...jonathanpeppers:RefreshViewLeak
If you create a custom ICommand
on something like a singleton ViewModel
, and use it on a RefreshView
, the RefreshView
will live forever.
I think this is lower priority, as the customer samples I've seen use Command
or Command<T>
:
maui/src/Controls/src/Core/Command.cs
Lines 113 to 117 in 49d22ac
And WeakEventManager
sidesteps this problem.
If we fix this, it might be worth auditing all properties of type ICommand
.
Steps to Reproduce
- Create a custom
ICommand
- Use it on
RefreshView
RefreshView
lives forever
Link to public reproduction project repository
main...jonathanpeppers:RefreshViewLeak
Version with bug
8.0.0-preview.5.8529
Last version that worked well
Unknown/Other
Affected platforms
iOS, Android, Windows, macOS, Other (Tizen, Linux, etc. not supported by Microsoft directly)
Affected platform versions
All
Did you find any workaround?
Use Command
.
Relevant log output
No response