Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[core] WeakEventManager.RemoveEventHandler() should clear subscriptions
Context: #12039 Context: https://github.com/Vroomer/MAUI-master-detail-memory-leak Context: https://github.com/symbiogenesis/Maui.DataGrid/tree/memory-leak Reviewing memory snapshots in the above apps, sometimes I would see new `WeakEventManager+Subscription` objects be created and never go away. I noticed the `WeakEventManager.RemoveEventHandler()` method did not remove any `Subscription` entries that it encountered were no longer alive. I could reproduce this problem in a test, and improved an existing test to check this collection is cleared appropriately: readonly Dictionary<string, List<Subscription>> _eventHandlers = new();
- Loading branch information