-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ios/catalyst] fix memory leaks in *Cell
#22067
Merged
Merged
Commits on May 16, 2024
-
[ios/catalyst] fix memory leaks in
*Cell
Context: https://github.com/AdamEssenmacher/MemoryToolkit.Maui/tree/main/samples Retesting this sample with the `ListView` leak fixed, I noticed the sample reports 0 leaks! Unfortunately, it still displayed memory growing over time... Taking a `.gcdump` snapshot, I noticed a cycle: * `ViewCellRenderer.ViewTableCell` -> `ViewCell _viewCell` -> `ViewCellRenderer` -> `ViewTableCell` I was able to write a test that reproduces the leak, and I extended it for every type of `*Cell` like `TextCell`, `ImageCell`, `SwitchCell`, etc. The fixes are: * `ViewTableCell` now uses a `WeakReference<ViewCell> _viewCell` * `CellTableViewCell` now uses a `WeakReference<Cell> _cell` * `CellTableViewCell` now uses a `WeakEventManager` for `PropertyChanged`, as the `*Renderer` subscribes to this event. Note that I changed `PropertyChanged` to an event, which is an API change. (I can revisit this if needed)
Configuration menu - View commit details
-
Copy full SHA for f349108 - Browse repository at this point
Copy the full SHA f349108View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6c1cb88 - Browse repository at this point
Copy the full SHA 6c1cb88View commit details -
One test was crashing (even on rerun), so maybe this will fix
Configuration menu - View commit details
-
Copy full SHA for bff1848 - Browse repository at this point
Copy the full SHA bff1848View commit details -
Configuration menu - View commit details
-
Copy full SHA for ee996a6 - Browse repository at this point
Copy the full SHA ee996a6View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6afe10b - Browse repository at this point
Copy the full SHA 6afe10bView commit details -
Configuration menu - View commit details
-
Copy full SHA for d9e0f64 - Browse repository at this point
Copy the full SHA d9e0f64View commit details -
Configuration menu - View commit details
-
Copy full SHA for 12c1161 - Browse repository at this point
Copy the full SHA 12c1161View commit details -
Configuration menu - View commit details
-
Copy full SHA for d518c87 - Browse repository at this point
Copy the full SHA d518c87View commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.