• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSSpeechSynthesizer lifetime and garbage collected (GC) applications
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: NSSpeechSynthesizer lifetime and garbage collected (GC) applications
      • From: Peter Ammon <email@hidden>
    • Re: NSSpeechSynthesizer lifetime and garbage collected (GC) applications
      • From: "Clark Cox" <email@hidden>
  • Prev by Date: Re: Learning How to Program in Objective-C
  • Next by Date: Re: Learning How to Program in Objective-C
  • Previous by thread: Re: Learning How to Program in Objective-C
  • Next by thread: Re: NSSpeechSynthesizer lifetime and garbage collected (GC) applications
  • Index(es):
    • Date
    • Thread