提交 e9be3974 编写于 作者: W Wu Zhong 提交者: Chris Bracken

Fixes oc leaks in platform plugin (#15041)

Some objc objects are not released in the iOS embedder. This fixes a
subset of those leaks in FlutterPlatformPlugin.mm.
上级 75c59c4f
......@@ -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];
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册