AVSpeechSynthesizer Leaking Like a Sieve

I've found multiple leaks in AVSpeechSynthesizer which are plaguing my users. My users are complaining of crashes due to this.

Ive created a feedback item (FB12212129) with a sample project attached which demonstrates one of the leaks. I'm hoping an engineer notices this. The only way ive hade my feedback noticed in the past is by both creating a feedback item AND posting on the forums. So here's my forum post. Help is much appreciated!

This seems to be fixed in the iOS 17 beta

I also see a lot of problems in TTS. Nothing is fixed, turn on Address Sanitizer in Xcode, it will crash immediately due to some memory issues (not on simulator). Please report on apple ´s feedbackassistent.

The memory leak that I was seeing seems to be fixed in iOS 17 but it still has performance issues. For example, it doesn't stop speaking immediately when you call stop(.immediate)

@And0Austria Yup just noticed the same thing...TTS will crash with the AddressSanitizer turned on iOS17. They are freeing a wild pointer according to the AddressSanitizer.

Looks like every app that uses AVSpeechSynthesizer has undefined behavior. I've been working on a feature for my app for a couple of months that uses this API and now after updating to iOS 17 it abruptly stops and random points in an utterance. Maybe it'll work. Maybe it won't.

I reported FB13188396 and made a thread about the issue here: https://developer.apple.com/forums/thread/737685

Kind of depressing that this was known two months ago and still made it into the iOS 17 release.

I have reported similar issues with TTS in iOS17 here https://feedbackassistant.apple.com/feedback/13251414 You can not access the report, but you can mention this report to Apple in your own reports.

Got Xcode 15.3 Beta with iOS 17.2 fixes the problem

AVSpeechSynthesizer Leaking Like a Sieve
 
 
Q