-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ios] fix memory leak in
TableView
(#18718)
Context: #18365 I could reproduce a leak in `TableView` by adding a parameterized test: [InlineData(typeof(TableView))] public async Task HandlerDoesNotLeak(Type type) `TableViewModelRenderer` has two cycles: * `TableView` -> * `TableViewRenderer` -> * `TableViewModelRenderer` -> * `TableView` via `View` field * `UITableView.Source` -> * `TableViewModelRenderer` -> * `UITableView` via `Table` field I left the `Table` and `View` fields in place to not break any public APIs. They are now unused and marked `[Obsolete]`. I used `WeakReference<T>` to solve these two cycles and the test now passes. The analyzer warned about these locations, but we don't have the analyzer enabled on `Microsoft.Maui.Controls` yet: #18318 (comment)
- Loading branch information
1 parent
90cb3b5
commit c10043f
Showing
2 changed files
with
54 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters