RefreshView
can have a memory leak with a custom ICommand
#16124
Labels
area-controls-refreshview
RefreshView
delighter
delighter-sc
memory-leak 💦
Memory usage grows / objects live forever (sub: perf)
platform/android 🤖
platform/iOS 🍎
platform/macOS 🍏
macOS / Mac Catalyst
platform/windows 🪟
s/triaged
Issue has been reviewed
t/bug
Something isn't working
Milestone
Description
This problem can be illustrated with a test such as:
main...jonathanpeppers:RefreshViewLeak
If you create a custom
ICommand
on something like a singletonViewModel
, and use it on aRefreshView
, theRefreshView
will live forever.I think this is lower priority, as the customer samples I've seen use
Command
orCommand<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
ICommand
RefreshView
RefreshView
lives foreverLink 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
The text was updated successfully, but these errors were encountered: