diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformPlugin.mm b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformPlugin.mm index aaf05854ea..809c467a4e 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformPlugin.mm +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformPlugin.mm @@ -108,14 +108,16 @@ using namespace flutter; if (@available(iOS 10, *)) { if ([@"HapticFeedbackType.lightImpact" isEqualToString:feedbackType]) { - [[[UIImpactFeedbackGenerator alloc] initWithStyle:UIImpactFeedbackStyleLight] impactOccurred]; + [[[[UIImpactFeedbackGenerator alloc] initWithStyle:UIImpactFeedbackStyleLight] autorelease] + impactOccurred]; } else if ([@"HapticFeedbackType.mediumImpact" isEqualToString:feedbackType]) { - [[[UIImpactFeedbackGenerator alloc] initWithStyle:UIImpactFeedbackStyleMedium] + [[[[UIImpactFeedbackGenerator alloc] initWithStyle:UIImpactFeedbackStyleMedium] autorelease] impactOccurred]; } else if ([@"HapticFeedbackType.heavyImpact" isEqualToString:feedbackType]) { - [[[UIImpactFeedbackGenerator alloc] initWithStyle:UIImpactFeedbackStyleHeavy] impactOccurred]; + [[[[UIImpactFeedbackGenerator alloc] initWithStyle:UIImpactFeedbackStyleHeavy] autorelease] + impactOccurred]; } else if ([@"HapticFeedbackType.selectionClick" isEqualToString:feedbackType]) { - [[[UISelectionFeedbackGenerator alloc] init] selectionChanged]; + [[[[UISelectionFeedbackGenerator alloc] init] autorelease] selectionChanged]; } } }