diff --git a/AUTHORS b/AUTHORS index c018e61980aff..5993e30445856 100644 --- a/AUTHORS +++ b/AUTHORS @@ -24,4 +24,6 @@ TheOneWithTheBraid Twin Sun, LLC Qixing Cao LinXunFeng -Amir Panahandeh \ No newline at end of file +Amir Panahandeh +Rulong Chen(陈汝龙) + diff --git a/shell/platform/darwin/ios/framework/Source/FlutterPlatformViewsTest.mm b/shell/platform/darwin/ios/framework/Source/FlutterPlatformViewsTest.mm index f8c878f5639a8..f64a4db8bc284 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterPlatformViewsTest.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterPlatformViewsTest.mm @@ -246,6 +246,17 @@ - (void)testChildClippingViewHitTests { XCTAssertTrue([childClippingView pointInside:CGPointMake(199, 199) withEvent:nil]); } +- (void)testReleasesBackdropFilterSubviewsOnChildClippingViewDealloc { + __weak NSMutableArray* weakBackdropFilterSubviews = nil; + @autoreleasepool { + ChildClippingView* clipping_view = [[ChildClippingView alloc] initWithFrame:CGRectZero]; + weakBackdropFilterSubviews = clipping_view.backdropFilterSubviews; + XCTAssertNotNil(weakBackdropFilterSubviews); + clipping_view = nil; + } + XCTAssertNil(weakBackdropFilterSubviews); +} + - (void)testApplyBackdropFilter { flutter::FlutterPlatformViewsTestMockPlatformViewDelegate mock_delegate; auto thread_task_runner = CreateNewThread("FlutterPlatformViewsTest"); diff --git a/shell/platform/darwin/ios/framework/Source/FlutterPlatformViews_Internal.h b/shell/platform/darwin/ios/framework/Source/FlutterPlatformViews_Internal.h index bf964dbcfa115..6dba0efd89365 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterPlatformViews_Internal.h +++ b/shell/platform/darwin/ios/framework/Source/FlutterPlatformViews_Internal.h @@ -120,6 +120,8 @@ // filters. - (void)applyBlurBackdropFilters:(NSArray*)filters; +// For testing only. +- (NSMutableArray*)backdropFilterSubviews; @end namespace flutter { diff --git a/shell/platform/darwin/ios/framework/Source/FlutterPlatformViews_Internal.mm b/shell/platform/darwin/ios/framework/Source/FlutterPlatformViews_Internal.mm index ced139de2c9c1..2aa13f5ae09f5 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterPlatformViews_Internal.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterPlatformViews_Internal.mm @@ -236,7 +236,7 @@ - (void)dealloc { - (NSMutableArray*)backdropFilterSubviews { if (!_backdropFilterSubviews) { - _backdropFilterSubviews = [[[NSMutableArray alloc] init] retain]; + _backdropFilterSubviews = [[NSMutableArray alloc] init]; } return _backdropFilterSubviews; }