Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 1d817283101f0fff904f893bc3ea38afab64c8bf
      
https://github.com/WebKit/WebKit/commit/1d817283101f0fff904f893bc3ea38afab64c8bf
  Author: Andres Gonzalez <[email protected]>
  Date:   2024-09-05 (Thu, 05 Sep 2024)

  Changed paths:
    M LayoutTests/accessibility/misspelling-range.html
    M Source/WebCore/accessibility/cocoa/AXTextMarkerCocoa.mm

  Log Message:
  -----------
  AX: misspelling-range.html is pass crash flaky.
https://bugs.webkit.org/show_bug.cgi?id=279145
<rdar://problem/135298645>

Reviewed by David Kilzer and Alexey Proskuryakov.

The random crash is caused by AXTextMarkerRange::platformData() returning 
adoptNS(@[...]). @[] creates an autoreleased object, and adoptNS will take 
ownership of the object, thus doubly releasing it when the variable goes out of 
scope. The fix is to return adoptNS([[NSArray alloc] initWithObjects:...]) 
instead of adoptNS(@[...]). [NSArray alloc] creates a retained object, not 
autoreleased, that can be adopted.

In addition, the elements in the array are now added without calling 
autorelease() on them, which is slightly more efficient (thanks to David Kilzer 
for the suggestion and explanation).

* LayoutTests/accessibility/misspelling-range.html: Removed unnecessary line, 
not related to crash.
* Source/WebCore/accessibility/cocoa/AXTextMarkerCocoa.mm:
(WebCore::AXTextMarkerRange::platformData const):

Canonical link: https://commits.webkit.org/283206@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to