Merged
Conversation
Context: #16346 This addresses the memory leak discovered by: src/Core/src/Platform/iOS/MauiTextView.cs(37,30): error MA0001: Event 'TextSetOrChanged' could cause memory leaks in an NSObject subclass. Remove the event or add the [UnconditionalSuppressMessage("Memory", "MA0001")] attribute with a justification as to why the event will not leak. src/Core/src/Platform/iOS/MauiTextView.cs(12,20): error MA0002: Member '_placeholderLabel' could cause memory leaks in an NSObject subclass. Remove the member, store the value as a WeakReference, or add the [UnconditionalSuppressMessage("Memory", "MA0002")] attribute with a justification as to why the member will not leak. I could reproduce a leak in a test such as: await InvokeOnMainThreadAsync(() => { var layout = new Grid(); var editor = new Editor(); layout.Add(editor); var handler = CreateHandler<LayoutHandler>(layout); viewReference = new WeakReference(editor); handlerReference = new WeakReference(editor.Handler); platformViewReference = new WeakReference(editor.Handler.PlatformView); }); await AssertionExtensions.WaitForGC(viewReference, handlerReference, platformViewReference); Assert.False(viewReference.IsAlive, "Editor should not be alive!"); Assert.False(handlerReference.IsAlive, "Handler should not be alive!"); Assert.False(platformViewReference.IsAlive, "PlatformView should not be alive!"); I will create a similar PR for `Entry` as well.
Context: #16346 This addresses the memory leak discovered by: src/Core/src/Platform/iOS/MauiTextField.cs(69,32): error MA0001: Event 'SelectionChanged' could cause memory leaks in an NSObject subclass. Remove the event or add the [UnconditionalSuppressMessage("Memory", "MA0001")] attribute with a justification as to why the event will not leak. src/Core/src/Platform/iOS/MauiTextField.cs(68,30): error MA0001: Event 'TextPropertySet' could cause memory leaks in an NSObject subclass. Remove the event or add the [UnconditionalSuppressMessage("Memory", "MA0001")] attribute with a justification as to why the event will not leak. I could reproduce a leak in a test such as: await InvokeOnMainThreadAsync(() => { var layout = new Grid(); var entry = new Entry(); layout.Add(entry); var handler = CreateHandler<LayoutHandler>(layout); viewReference = new WeakReference(entry); handlerReference = new WeakReference(entry.Handler); platformViewReference = new WeakReference(entry.Handler.PlatformView); }); await AssertionExtensions.WaitForGC(viewReference, handlerReference, platformViewReference); Assert.False(viewReference.IsAlive, "Entry should not be alive!"); Assert.False(handlerReference.IsAlive, "Handler should not be alive!"); Assert.False(platformViewReference.IsAlive, "PlatformView should not be alive!");
Context: #16346 This addresses the memory leak discovered by: src/Core/src/Platform/iOS/MauiDoneAccessoryView.cs(11,19): error MA0002: Member '_doneClicked' could cause memory leaks in an NSObject subclass. Remove the member, store the value as a WeakReference, or add the [UnconditionalSuppressMessage("Memory", "MA0002")] attribute with a justification as to why the member will not leak. After writing a test for it, I found a pattern the analyze doesn't currently catch: public MauiDoneAccessoryView(Action doneClicked) { //... var doneButton = new UIBarButtonItem(UIBarButtonSystemItem.Done, OnClicked); SetItems(new[] { spacer, doneButton }, false); } This creates a cycle: * `MauiDoneAccessoryView` -> `UIBarButtonItem` via list of items * `UIBarButtonItem` -> `Action` -> `MauiDoneAccessoryView` via `OnClicked` `MauiDoneAccessoryView` lives forever, as well as the owners of any `Action` delegate values passed in. I could resolve these problems by creating a new non-NSObject `BarButtonItemProxy` type to handle events. This solves one leak with the following controls that use `MauiDoneAccessoryView`: * `Editor` * `Picker` * `DatePicker` * `TimePicker` However, I'll need to send future PRs to verify all these controls are 100% leak free.
* Fix SwipeView DeviceTests on Windows * Updated Impl * Update HandlerTestBasement.cs --------- Co-authored-by: Shane Neuville <shneuvil@microsoft.com>
Bumps the windowsappsdk group with 1 update: [Microsoft.WindowsAppSDK](https://github.com/microsoft/windowsappsdk). - [Release notes](https://github.com/microsoft/windowsappsdk/releases) - [Commits](https://github.com/microsoft/windowsappsdk/commits) --- updated-dependencies: - dependency-name: Microsoft.WindowsAppSDK dependency-type: direct:production update-type: version-update:semver-patch dependency-group: windowsappsdk ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps the androidx group with 1 update: [Xamarin.Google.Crypto.Tink.Android](https://github.com/xamarin/AndroidX). - [Commits](https://github.com/xamarin/AndroidX/commits) --- updated-dependencies: - dependency-name: Xamarin.Google.Crypto.Tink.Android dependency-type: direct:production update-type: version-update:semver-minor dependency-group: androidx ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* Avoid CheckBox leak on iOS * Added UnconditionalSuppressMessage * Avoid breaking changes
Context: #16346 This addresses the memory leak discovered by: src/Core/src/Platform/iOS/MauiRefreshView.cs(17,10): error MA0002: Member '_refreshControlParent' could cause memory leaks in an NSObject subclass. Remove the member, store the value as a WeakReference, or add the [UnconditionalSuppressMessage("Memory", "MA0002")] attribute with a justification as to why the member will not leak. src/Core/src/Platform/iOS/MauiRefreshView.cs(18,11): error MA0002: Member '_contentView' could cause memory leaks in an NSObject subclass. Remove the member, store the value as a WeakReference, or add the [UnconditionalSuppressMessage("Memory", "MA0002")] attribute with a justification as to why the member will not leak. src/Core/src/Platform/iOS/MauiRefreshView.cs(19,20): error MA0002: Member '_refreshControl' could cause memory leaks in an NSObject subclass. Remove the member, store the value as a WeakReference, or add the [UnconditionalSuppressMessage("Memory", "MA0002")] attribute with a justification as to why the member will not leak. I could reproduce a leak in a test such as: await InvokeOnMainThreadAsync(() => { var layout = new Grid(); var refreshView = new RefreshView(); layout.Add(refreshView); var handler = CreateHandler<LayoutHandler>(layout); viewReference = new WeakReference(refreshView); handlerReference = new WeakReference(refreshView.Handler); platformViewReference = new WeakReference(refreshView.Handler.PlatformView); }); await AssertionExtensions.WaitForGC(viewReference, handlerReference, platformViewReference); Assert.False(viewReference.IsAlive, "RefreshView should not be alive!"); Assert.False(handlerReference.IsAlive, "Handler should not be alive!"); Assert.False(platformViewReference.IsAlive, "PlatformView should not be alive!"); Solved the issues by making a non-NSObject `MauiRefreshViewProxy` class.
We can convert this to a single parameterized test. Future fixes can add new `[InlineData]` instead of creating new tests.
* Add test for picker bug * well, fix the bug. That's what I do --------- Co-authored-by: Stephane Delcroix (HE/HIM) (from Dev Box) <stdelc@microsoft.com>
* [uitests] Try add log files as attachments * [build] Try provision certs with provisionator * Fix * fix * Remove superfluous space for gitHubToken setting --------- Co-authored-by: Mike Bond <mjbond-msft@outlook.com>
# Conflicts: # eng/Versions.props
PureWeen
approved these changes
Jul 28, 2023
javiercn
approved these changes
Jul 28, 2023
Member
javiercn
left a comment
There was a problem hiding this comment.
I don't have much context but the changes look reasonable
mattleibow
approved these changes
Jul 28, 2023
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.
Description of Change
Bring latest changes from main branch to net8.
Important as it fixes certs installation.