File tree 2 files changed +17
-2
lines changed
shell/platform/darwin/ios/framework/Source 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -387,8 +387,8 @@ - (void)dealloc {
387
387
}
388
388
389
389
- (UITextField*)textField {
390
- if (_textField == nil ) {
391
- _textField = [[[ UITextField alloc ] init ] autorelease ];
390
+ if (! _textField) {
391
+ _textField = [[UITextField alloc ] init ];
392
392
}
393
393
return _textField;
394
394
}
Original file line number Diff line number Diff line change @@ -17,6 +17,10 @@ - (void)setTextInputState:(NSDictionary*)state;
17
17
- (BOOL )isVisibleToAutofill ;
18
18
@end
19
19
20
+ @interface FlutterSecureTextInputView : FlutterTextInputView
21
+ @property (nonatomic , strong ) UITextField* textField;
22
+ @end
23
+
20
24
@interface FlutterTextInputPlugin ()
21
25
@property (nonatomic , strong ) FlutterTextInputView* reusableInputView;
22
26
@property (nonatomic , assign ) FlutterTextInputView* activeView;
@@ -496,4 +500,15 @@ - (void)testUITextInputCallsUpdateEditingStateOnce {
496
500
[inputView unmarkText ];
497
501
XCTAssertEqual (updateCount, 6 );
498
502
}
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
+ }
499
514
@end
You can’t perform that action at this time.
0 commit comments