From 29fe2d75a56255c3bc0ec98cbbf03c6108e7405c 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 (flutter/engine#18107) --- .../darwin/ios/framework/Source/accessibility_bridge.mm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/accessibility_bridge.mm b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/accessibility_bridge.mm index 08d8069841f..3e1da1bdd1d 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/accessibility_bridge.mm +++ b/engine/src/flutter/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]; }