[ios] update MemoryAnalyzers package, add to Controls#18318
Closed
jonathanpeppers wants to merge 2 commits into
Closed
[ios] update MemoryAnalyzers package, add to Controls#18318jonathanpeppers wants to merge 2 commits into
MemoryAnalyzers package, add to Controls#18318jonathanpeppers wants to merge 2 commits into
Conversation
* Use MemoryAnalyzers `0.1.0-beta.4` * Rename `Microsoft.Extensions.targets` to `NuGetVersions.targets` as it contains many more packages beyond Microsoft.Extensions * Track MemoryAnalyzers version in `NuGetVersions.targets` * Use analyzer in `Controls.Core.csproj`, this will currently have lots of errors
Contributor
|
Oh, this is great. Taking a look to the build, it already have found 362 errors spread between different renderers, mainly ListViewRenderer, Shell renderers etc. |
Member
Author
|
When you take out the iOS/Catalyst duplicates, I think there are 181: |
Member
Author
|
There might also be a bug or two in the analyzer, like this one seems odd ( |
21 tasks
jonathanpeppers
added a commit
to jonathanpeppers/maui
that referenced
this pull request
Nov 13, 2023
Context: dotnet#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: dotnet#18318 (comment)
rmarinho
pushed a commit
that referenced
this pull request
Nov 17, 2023
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)
Member
Author
|
The warnings have increased as I improved the analyzer, 214 now: |
Member
|
/rebase |
Member
|
/rebase |
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
0.1.0-beta.4Microsoft.Extensions.targetstoNuGetVersions.targetsas it contains many more packages beyond Microsoft.ExtensionsNuGetVersions.targetsControls.Core.csproj, this will currently have lots of errors