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 a0e10c6190..ad583c49d1 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 @@ -795,11 +795,12 @@ static FlutterAutofillType autofillTypeOf(NSDictionary* configuration) { withEvent:(UIPressesEvent*)event API_AVAILABLE(ios(9.0)) { if (@available(iOS 13.4, *)) { for (UIPress* press in presses) { - [_textInputDelegate handlePressEvent:[[FlutterUIPressProxy alloc] initWithPress:press - withEvent:event] - nextAction:^() { - [super pressesBegan:[NSSet setWithObject:press] withEvent:event]; - }]; + [_textInputDelegate + handlePressEvent:[[[FlutterUIPressProxy alloc] initWithPress:press + withEvent:event] autorelease] + nextAction:^() { + [super pressesBegan:[NSSet setWithObject:press] withEvent:event]; + }]; } } else { [super pressesBegan:presses withEvent:event]; @@ -811,7 +812,8 @@ static FlutterAutofillType autofillTypeOf(NSDictionary* configuration) { if (@available(iOS 13.4, *)) { for (UIPress* press in presses) { [_textInputDelegate - handlePressEvent:[[FlutterUIPressProxy alloc] initWithPress:press withEvent:event] + handlePressEvent:[[[FlutterUIPressProxy alloc] initWithPress:press + withEvent:event] autorelease] nextAction:^() { [super pressesChanged:[NSSet setWithObject:press] withEvent:event]; }]; @@ -825,11 +827,12 @@ static FlutterAutofillType autofillTypeOf(NSDictionary* configuration) { withEvent:(UIPressesEvent*)event API_AVAILABLE(ios(9.0)) { if (@available(iOS 13.4, *)) { for (UIPress* press in presses) { - [_textInputDelegate handlePressEvent:[[FlutterUIPressProxy alloc] initWithPress:press - withEvent:event] - nextAction:^() { - [super pressesEnded:[NSSet setWithObject:press] withEvent:event]; - }]; + [_textInputDelegate + handlePressEvent:[[[FlutterUIPressProxy alloc] initWithPress:press + withEvent:event] autorelease] + nextAction:^() { + [super pressesEnded:[NSSet setWithObject:press] withEvent:event]; + }]; } } else { [super pressesEnded:presses withEvent:event]; @@ -841,7 +844,8 @@ static FlutterAutofillType autofillTypeOf(NSDictionary* configuration) { if (@available(iOS 13.4, *)) { for (UIPress* press in presses) { [_textInputDelegate - handlePressEvent:[[FlutterUIPressProxy alloc] initWithPress:press withEvent:event] + handlePressEvent:[[[FlutterUIPressProxy alloc] initWithPress:press + withEvent:event] autorelease] nextAction:^() { [super pressesCancelled:[NSSet setWithObject:press] withEvent:event]; }]; diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm index 5666f336af..cc5ac62d38 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm @@ -1156,7 +1156,8 @@ static flutter::PointerData::DeviceKind DeviceKindFromTouchType(UITouch* touch) withEvent:(UIPressesEvent*)event API_AVAILABLE(ios(9.0)) { if (@available(iOS 13.4, *)) { for (UIPress* press in presses) { - [self handlePressEvent:[[FlutterUIPressProxy alloc] initWithPress:press withEvent:event] + [self handlePressEvent:[[[FlutterUIPressProxy alloc] initWithPress:press + withEvent:event] autorelease] nextAction:^() { [super pressesBegan:[NSSet setWithObject:press] withEvent:event]; }]; @@ -1170,7 +1171,8 @@ static flutter::PointerData::DeviceKind DeviceKindFromTouchType(UITouch* touch) withEvent:(UIPressesEvent*)event API_AVAILABLE(ios(9.0)) { if (@available(iOS 13.4, *)) { for (UIPress* press in presses) { - [self handlePressEvent:[[FlutterUIPressProxy alloc] initWithPress:press withEvent:event] + [self handlePressEvent:[[[FlutterUIPressProxy alloc] initWithPress:press + withEvent:event] autorelease] nextAction:^() { [super pressesChanged:[NSSet setWithObject:press] withEvent:event]; }]; @@ -1184,7 +1186,8 @@ static flutter::PointerData::DeviceKind DeviceKindFromTouchType(UITouch* touch) withEvent:(UIPressesEvent*)event API_AVAILABLE(ios(9.0)) { if (@available(iOS 13.4, *)) { for (UIPress* press in presses) { - [self handlePressEvent:[[FlutterUIPressProxy alloc] initWithPress:press withEvent:event] + [self handlePressEvent:[[[FlutterUIPressProxy alloc] initWithPress:press + withEvent:event] autorelease] nextAction:^() { [super pressesEnded:[NSSet setWithObject:press] withEvent:event]; }]; @@ -1198,7 +1201,8 @@ static flutter::PointerData::DeviceKind DeviceKindFromTouchType(UITouch* touch) withEvent:(UIPressesEvent*)event API_AVAILABLE(ios(9.0)) { if (@available(iOS 13.4, *)) { for (UIPress* press in presses) { - [self handlePressEvent:[[FlutterUIPressProxy alloc] initWithPress:press withEvent:event] + [self handlePressEvent:[[[FlutterUIPressProxy alloc] initWithPress:press + withEvent:event] autorelease] nextAction:^() { [super pressesCancelled:[NSSet setWithObject:press] withEvent:event]; }];