diff --git a/shell/platform/darwin/ios/framework/Source/accessibility_bridge.mm b/shell/platform/darwin/ios/framework/Source/accessibility_bridge.mm index 8efbd498e1c92..240a16fcf15e5 100644 --- a/shell/platform/darwin/ios/framework/Source/accessibility_bridge.mm +++ b/shell/platform/darwin/ios/framework/Source/accessibility_bridge.mm @@ -242,6 +242,7 @@ static void ReplaceSemanticsObject(SemanticsObject* oldObject, assert(oldObject.node.id == newObject.uid); NSNumber* nodeId = @(oldObject.node.id); NSUInteger positionInChildlist = [oldObject.parent.children indexOfObject:oldObject]; + [[oldObject retain] autorelease]; [objects removeObjectForKey:nodeId]; [oldObject.parent replaceChildAtIndex:positionInChildlist withChild:newObject]; objects[nodeId] = newObject;