forked from dotnet/maui
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ios/catalyst] fix memory leak in DatePicker
Context: dotnet#16346 This addresses the memory leak discovered by: src/Core/src/Platform/iOS/MauiDatePicker.cs(37,27): error MA0003: Subscribing to events with instance method 'OnValueChanged' could cause memory leaks in an NSObject subclass. Remove the subscription or convert the method to a static method. I could reproduce a leak in `MemoryTests.cs`: ++[InlineData(typeof(DatePicker))] public async Task HandlerDoesNotLeak(Type type) Solved the problem by fixing two places: * `MauiDatePicker` now uses a `UIDatePickerProxy` type, for iOS * `DatePickerHandler.MacCatalyst.cs` now uses a `UIDatePickerProxy` type, for MacCatalyst.
- Loading branch information
1 parent
9079f91
commit a1fa07e
Showing
3 changed files
with
63 additions
and
31 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
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