-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Labels
area-controls-refreshviewRefreshViewRefreshViewdelighterdelighter-scpartner/cat 😻this is an issue that impacts one of our partners or a customer our advisory team is engaged withthis is an issue that impacts one of our partners or a customer our advisory team is engaged withperf/memory-leak 💦Memory usage grows / objects live forever (sub: perf)Memory usage grows / objects live forever (sub: perf)platform/androidplatform/iosplatform/macosmacOS / Mac CatalystmacOS / Mac Catalystplatform/windowss/triagedIssue has been reviewedIssue has been reviewedt/bugSomething isn't workingSomething isn't working
Milestone
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
| public event EventHandler CanExecuteChanged | |
| { | |
| add { _weakEventManager.AddEventHandler(value); } | |
| remove { _weakEventManager.RemoveEventHandler(value); } | |
| } |
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 RefreshViewlives 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
dk-mushiyokedk-mushiyoke
Metadata
Metadata
Assignees
Labels
area-controls-refreshviewRefreshViewRefreshViewdelighterdelighter-scpartner/cat 😻this is an issue that impacts one of our partners or a customer our advisory team is engaged withthis is an issue that impacts one of our partners or a customer our advisory team is engaged withperf/memory-leak 💦Memory usage grows / objects live forever (sub: perf)Memory usage grows / objects live forever (sub: perf)platform/androidplatform/iosplatform/macosmacOS / Mac CatalystmacOS / Mac Catalystplatform/windowss/triagedIssue has been reviewedIssue has been reviewedt/bugSomething isn't workingSomething isn't working