diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.mm b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.mm index 2463a17f78..625a4d4bf0 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.mm +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.mm @@ -2190,7 +2190,7 @@ static BOOL IsSelectionRectBoundaryCloserToPoint(CGPoint point, 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/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterViewControllerTest.mm b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterViewControllerTest.mm index f20e2280ce..54bca88f57 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterViewControllerTest.mm +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterViewControllerTest.mm @@ -1055,6 +1055,16 @@ extern NSNotificationName const FlutterViewControllerWillDealloc; 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 {