Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 1b953e1a0f16b1bd079b1e48cdc348ce42eaadc9
      
https://github.com/WebKit/WebKit/commit/1b953e1a0f16b1bd079b1e48cdc348ce42eaadc9
  Author: David Kilzer <[email protected]>
  Date:   2026-07-12 (Sun, 12 Jul 2026)

  Changed paths:
    M Source/WebCore/platform/cocoa/PlatformSpeechSynthesizerCocoa.mm

  Log Message:
  -----------
  WebSpeechSynthesisWrapper crashes on voice change notification
<https://bugs.webkit.org/show_bug.cgi?id=308938>
<rdar://171479344>

Reviewed by Ryosuke Niwa.

This is a merge-back of the safari-7624-branch fix.  The
`-availableVoicesDidChange` main-thread hop and null-check that the
original fix added already landed independently on `main` in
312522@main (Bug 313950, rdar://173555693) via `ensureOnMainThread`.
This merge-back therefore preserves `main`'s existing
`-availableVoicesDidChange` and applies only the remaining `-dealloc`
change from the original fix.

`WebSpeechSynthesisWrapper` registers as an observer for
`AVSpeechSynthesisAvailableVoicesDidChangeNotification` but never
removed itself.  Add `-dealloc` to call `-removeObserver:name:object:`
on `NSNotificationCenter`.  While Foundation stores observers as
zeroing weak references that auto-invalidate when the observer is
deallocated, it is best practice to remove the registration promptly.

No new tests since no change in behavior.

* Source/WebCore/platform/cocoa/PlatformSpeechSynthesizerCocoa.mm:
(-[WebSpeechSynthesisWrapper dealloc]): Add.

Originally-landed-as: 305413.387@safari-7624-branch (4627c5152694). 
rdar://171479344
Canonical link: https://commits.webkit.org/317002@main



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

Reply via email to