NSSpeechSynthesizer lifetime and garbage collected (GC) applications
NSSpeechSynthesizer lifetime and garbage collected (GC) applications
- Subject: NSSpeechSynthesizer lifetime and garbage collected (GC) applications
- From: "Sean McBride" <email@hidden>
- Date: Fri, 11 Jul 2008 10:20:25 -0400
- Organization: Rogue Research
Hi all,
The following works just fine in non-GC apps when called in an IBAction
method:
NSSpeechSynthesizer* speechSynthesizer =
[[[NSSpeechSynthesizer alloc] init] autorelease];
[speechSynthesizer startSpeakingString:
@"Hello. I'm Macintosh. It sure is great to get out of that bag."];
In GC apps it crashes (non main thread):
#0 0x907586e8 in objc_msgSend ()
#1 0x952f6f23 in SpeechDoneProc ()
#2 0x1f00d979 in MTBEDoneTask::Execute ()
#3 0x1f018b01 in MTBEWorker::WorkLoop ()
#4 0x1f018b5d in MTBEWorkerStartMPTask ()
#5 0x91ec555b in PrivateMPEntryPoint ()
#6 0x96fa76f5 in _pthread_start ()
#7 0x96fa75b2 in thread_start ()
I'm guessing this is because the speechSynthesizer is collected before
it finishes speaking. Is this 'correct behaviour' or a bug? Needless
to say, the docs say nothing about special considerations for garbage
collection. My speechSynthesizer has no delegate, and I don't care when
it starts or stops speaking. Shouldn't that make it
NSSpeechSynthesizer's job to keep itself alive until it finishes
speaking? Afterall, _I'm_ finished with the speechSynthesizer.
Thanks,
--
____________________________________________________________
Sean McBride, B. Eng email@hidden
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden