Re: NSCFNumber, no pool in place - just leaking
Re: NSCFNumber, no pool in place - just leaking
- Subject: Re: NSCFNumber, no pool in place - just leaking
- From: MacInsight <email@hidden>
- Date: Fri, 27 Dec 2002 04:43:55 +0100
Hi,
Am Donnerstag, 26.12.02 um 20:30 Uhr schrieb Craig Bakalian:
-(void)addToneToTones: (unsigned)toneValue
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSNumber *n = [[NSNumber alloc] initWithUnsignedInt: toneValue];
[tones addObject: n];
[n release];
[pool release];
}
-(void)clearToneFromTones: (unsigned)toneValue
{
NSAutoreleasePool *deletePool = [[NSAutoreleasePool alloc]init];
[tones removeLastObject];
[deletePool release];
}
I'd say, you're handling your AutoreleasePools in a proper way;
though, if you don't plan to add any further code between the pool's
allocation/initialization call and the pool's release call, the
AutoreleasePool doesn't seem to be necessary at all, because you're not
adding any objects to it...
Greetings,
Dirk Stegemann
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.