• 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: NSCFNumber, no pool in place - just leaking
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSCFNumber, no pool in place - just leaking


  • Subject: Re: NSCFNumber, no pool in place - just leaking
  • From: Roarke Lynch <email@hidden>
  • Date: Mon, 23 Dec 2002 17:34:31 -0500

On Monday, December 23, 2002, at 03:55 PM, Craig Bakalian wrote:

-(void)addToneToTones: (unsigned)toneValue
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSNumber *n = [NSNumber numberWithUnsignedInt: toneValue];
[tones addObject: n];
[n release];
[pool release];
}

You might get another error here. You are calling release on an object that should already be autoreleased. More to the point, by creating n without an alloc/init call, but still releasing it, you are violating the alloc/retain <-> autorelease/release balance within the method.

Roarke Lynch
-------------------------------
email@hidden
_______________________________________________
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.

  • Follow-Ups:
    • Re: NSCFNumber, no pool in place - just leaking
      • From: Craig Bakalian <email@hidden>
References: 
 >Re: NSCFNumber, no pool in place - just leaking (From: Craig Bakalian <email@hidden>)

  • Prev by Date: Re: Problems with DO
  • Next by Date: Implementing a status indicator (like iChat's)
  • Previous by thread: Re: NSCFNumber, no pool in place - just leaking
  • Next by thread: Re: NSCFNumber, no pool in place - just leaking
  • Index(es):
    • Date
    • Thread