From 47836dc8a507003898d1e0007811dbd2deae8a4b Mon Sep 17 00:00:00 2001 From: Wu Zhong Date: Thu, 21 May 2020 02:35:37 +0800 Subject: [PATCH] Fixes Semantic Object memory leak cause of wrong release call (#18107) --- .../darwin/ios/framework/Source/accessibility_bridge.mm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/shell/platform/darwin/ios/framework/Source/accessibility_bridge.mm b/shell/platform/darwin/ios/framework/Source/accessibility_bridge.mm index 08d8069841f..3e1da1bdd1d 100644 --- a/shell/platform/darwin/ios/framework/Source/accessibility_bridge.mm +++ b/shell/platform/darwin/ios/framework/Source/accessibility_bridge.mm @@ -179,11 +179,10 @@ static SemanticsObject* CreateObject(const flutter::SemanticsNode& node, return [[[TextInputSemanticsObject alloc] initWithBridge:weak_ptr uid:node.id] autorelease]; } else if (node.HasFlag(flutter::SemanticsFlags::kHasToggledState) || node.HasFlag(flutter::SemanticsFlags::kHasCheckedState)) { - SemanticsObject* delegateObject = [[FlutterSemanticsObject alloc] initWithBridge:weak_ptr - uid:node.id]; + SemanticsObject* delegateObject = + [[[FlutterSemanticsObject alloc] initWithBridge:weak_ptr uid:node.id] autorelease]; return (SemanticsObject*)[[[FlutterSwitchSemanticsObject alloc] initWithSemanticsObject:delegateObject] autorelease]; - [delegateObject release]; } else { return [[[FlutterSemanticsObject alloc] initWithBridge:weak_ptr uid:node.id] autorelease]; }