diff --git a/shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.mm b/shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.mm index 2463a17f784ec..625a4d4bf0ac1 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.mm @@ -2190,7 +2190,7 @@ @interface FlutterTextInputPlugin () NSMutableDictionary* autofillContext; @property(nonatomic, retain) FlutterTextInputView* activeView; @property(nonatomic, retain) FlutterTextInputViewAccessibilityHider* inputHider; -@property(nonatomic, readonly) id viewResponder; +@property(nonatomic, readonly, weak) id viewResponder; @end @implementation FlutterTextInputPlugin { diff --git a/shell/platform/darwin/ios/framework/Source/FlutterViewControllerTest.mm b/shell/platform/darwin/ios/framework/Source/FlutterViewControllerTest.mm index f20e2280ce16c..54bca88f57e0f 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterViewControllerTest.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterViewControllerTest.mm @@ -1055,6 +1055,16 @@ - (void)testBinaryMessenger { OCMVerify([self.mockEngine binaryMessenger]); } +- (void)testViewControllerIsReleased { + __weak FlutterViewController* weakViewController; + @autoreleasepool { + FlutterViewController* viewController = [[FlutterViewController alloc] init]; + weakViewController = viewController; + [viewController viewDidLoad]; + } + XCTAssertNil(weakViewController); +} + #pragma mark - Platform Brightness - (void)testItReportsLightPlatformBrightnessByDefault {