Skip to content

Commit d92bebd

Browse files
[ios/catalyst] fix memory leaks in ListView (#22007)
* [ios/catalyst] fix memory leaks in ListView Fixes: #20025 I could reproduce the leak here, pretty easily with changes to `MemoryTests`. `ListView` has several cycles that prevent garbage collection from happening: * `FormsUITableViewController` has `ListView _list` * `FormsUITableViewController` -> `ListView` -> `ListViewRenderer` -> `FormsUITableViewController` * `ListViewDataSource` has `UITableView _uiTableView` * `ListViewDataSource` -> `UITableView` -> `ListViewDataSource` * `ListViewDataSource` has `FormsUITableViewController _uiTableViewController` * `ListViewDataSource` -> `FormsUITableViewController` -> `UITableView` -> `ListViewDataSource` * `ListViewDataSource` has `protected ListView List` * `ListViewDataSource` -> `ListView` -> `ListViewRenderer` -> `FormsUITableViewController` -> `UITableView` -> `ListViewDataSource` I changed the above fields to all be `WeakReference<T>` and the leaks went away. * Tentative fix for Android Context: #18757 * Revert "Tentative fix for Android" This reverts commit b294779. * Ignore ListView test on Android for now
1 parent a0abfd0 commit d92bebd

File tree

2 files changed

+143
-76
lines changed

2 files changed

+143
-76
lines changed

0 commit comments

Comments
 (0)