File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed
shell/platform/darwin/ios/framework/Source Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -387,8 +387,8 @@ - (void)dealloc {
387387}
388388
389389- (UITextField*)textField {
390- if (_textField == nil ) {
391- _textField = [[[ UITextField alloc ] init ] autorelease ];
390+ if (! _textField) {
391+ _textField = [[UITextField alloc ] init ];
392392 }
393393 return _textField;
394394}
Original file line number Diff line number Diff line change @@ -17,6 +17,10 @@ - (void)setTextInputState:(NSDictionary*)state;
1717- (BOOL )isVisibleToAutofill ;
1818@end
1919
20+ @interface FlutterSecureTextInputView : FlutterTextInputView
21+ @property (nonatomic , strong ) UITextField* textField;
22+ @end
23+
2024@interface FlutterTextInputPlugin ()
2125@property (nonatomic , strong ) FlutterTextInputView* reusableInputView;
2226@property (nonatomic , assign ) FlutterTextInputView* activeView;
@@ -496,4 +500,15 @@ - (void)testUITextInputCallsUpdateEditingStateOnce {
496500 [inputView unmarkText ];
497501 XCTAssertEqual (updateCount, 6 );
498502}
503+
504+ - (void )testNoZombies {
505+ // Regression test for https://github.com/flutter/flutter/issues/62501.
506+ FlutterSecureTextInputView* passwordView = [[FlutterSecureTextInputView alloc ] init ];
507+
508+ @autoreleasepool {
509+ // Initialize the lazy textField.
510+ [passwordView.textField description ];
511+ }
512+ XCTAssert ([[passwordView.textField description ] containsString: @" TextField" ]);
513+ }
499514@end
You can’t perform that action at this time.
0 commit comments