• 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
Re: NSSpeechSynthesizer leaking
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSSpeechSynthesizer leaking


  • Subject: Re: NSSpeechSynthesizer leaking
  • From: Vince DeMarco <email@hidden>
  • Date: Tue, 20 Dec 2005 11:13:28 -0800


in speachSynthesizer:didFinishSpeaking: you are retaining the inSender

which seems wrong, and will cause a leak.


On Dec 20, 2005, at 11:10 AM, Casey Fleser wrote:

I just need a quick sanity check to make sure I'm not seeing something obvious here before I submit this to Radar. Looks to me that NSSpeechSynthesizer isn't cleaning up after itself properly.

Just a quick and simple action to that grabs some text from an NSTextField. I subclassed NSSpeechSynthesizer (DebugSpeechSynthesizer) so I could NSLog from retain, release, and dealloc. DebugSpeechSynthesizer is getting dealloc'd, but there are huge chunks of memory that are not being reclaimed (the main culprits seem to live in MacinTalk AudioToolbox according to ObjectAlloc).

So anyway, am I missing something here? (for the record DebugSpeechSynthesizer does call [super dealloc]). Clicking the speak button repeatedly in my little sample app will consume hundreds of megabytes of memory pretty quickly.

- (IBAction) speak: (id) inSender
{
NSSpeechSynthesizer *synthesizer =
[[DebugSpeechSynthesizer alloc] initWithVoice:
[NSSpeechSynthesizer defaultVoice]];

if (synthesizer != nil) {
[synthesizer setDelegate: self];
[synthesizer startSpeakingString: [_speechText stringValue]];
}
}

- (void) speechSynthesizer: (NSSpeechSynthesizer *) inSender
didFinishSpeaking: (BOOL) inFinishedSpeaking
{
NSLog(@"NSSpeechSynthesizer %@ finished", inSender);

[inSender release];
}

The demonstration app can be grabbed here if you like:

http://www.somegeekintn.com/download/SpeechTest.zip

Thanks for any insight,

Casey

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden
  • Follow-Ups:
    • Re: NSSpeechSynthesizer leaking
      • From: Casey Fleser <email@hidden>
References: 
 >NSSpeechSynthesizer leaking (From: Casey Fleser <email@hidden>)

  • Prev by Date: NSSpeechSynthesizer leaking
  • Next by Date: Re: Adding password for a file to keychain
  • Previous by thread: NSSpeechSynthesizer leaking
  • Next by thread: Re: NSSpeechSynthesizer leaking
  • Index(es):
    • Date
    • Thread