Skip to content

Commit

Permalink
Fix AccessibilityBridge crash due to invalid access during ReplaceSem…
Browse files Browse the repository at this point in the history
…anticsObject (flutter#31351)
  • Loading branch information
fbcouch authored Feb 10, 2022
1 parent 0f6db11 commit 321a482
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 321a482

Please sign in to comment.