Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 9323616ae50bf49f9a525d2f472a5511f94cb696
      
https://github.com/WebKit/WebKit/commit/9323616ae50bf49f9a525d2f472a5511f94cb696
  Author: David Kilzer <[email protected]>
  Date:   2026-04-26 (Sun, 26 Apr 2026)

  Changed paths:
    M Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm

  Log Message:
  -----------
  REGRESSION (304469@main): WTR::supportedAttributes() leaks NSMutableArray
<https://bugs.webkit.org/show_bug.cgi?id=313364>
<rdar://175635842>

Reviewed by Tyler Wilcock.

Adopt the +1 retained result of `-mutableCopy` with `adoptNS()`.
Without this, assigning the raw pointer to `RetainPtr` retains it
a second time, and the `RetainPtr` destructor only releases once,
leaving the array leaked.

The leak was introduced in Bug 304071 (304469@main) which changed
`supportedAttributes()` from returning a plain `RetainPtr<NSArray>`
(assigned from `-accessibilityAttributeNames`, a +0 return) to a
`RetainPtr<NSMutableArray>` (assigned from `-mutableCopy`, a +1
return) without adding `adoptNS()`.

Test using `run-webkit-tests --leaks`.

* Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm:
(WTR::supportedAttributes):

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to