• 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: if statement causing 32 Byte leak?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: if statement causing 32 Byte leak?


  • Subject: Re: if statement causing 32 Byte leak?
  • From: "Glenn L. Austin" <email@hidden>
  • Date: Sun, 10 Jan 2010 09:13:06 -0800

On Jan 10, 2010, at 8:01 AM, Scott Ribe wrote:

> Also, an isAutoReleased message would be worthless. At any point in time,
> you have no idea how many times library routines that you've called might
> have retained/released/autoreleased, nor should you care.

Actually, it would be nice to have *in a debugging context* since trying to track down a pointer that is in the autorelease pool the number of times it has been retained when you do a release would be very beneficial.  Yes, it would slow things down, but it would sure save a lot of time when trying to track down a spurious release!

e.g.

id pObj = [[[ObjectType alloc] init] autorelease];

... do something here that doesn't retain the pObj, maybe return the value to a caller...

[pObj release];	// <-- This should assert in a debug context, since it is already in the current autorelease pool.

// [pObj autorelease] should also probably assert, since it is now in the current autorelease pool twice...


What I ended up doing is progressively creating NSAutoreleasePools, running the code from that routine, then draining that pool until I found the culprit.  Oh the joys of working on a large project with programmers of varying Cocoa skill levels.

--
Glenn L. Austin, Computer Wizard and Race Car Driver         <><
<http://www.austin-soft.com>



_______________________________________________

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: if statement causing 32 Byte leak?
      • From: Scott Ribe <email@hidden>
    • Re: if statement causing 32 Byte leak?
      • From: Dave Camp <email@hidden>
    • Re: if statement causing 32 Byte leak?
      • From: Joar Wingfors <email@hidden>
    • Re: if statement causing 32 Byte leak?
      • From: Julien Jalon <email@hidden>
References: 
 >Re: if statement causing 32 Byte leak? (From: Scott Ribe <email@hidden>)

  • Prev by Date: [MEET] CocoaHeads-NYC this Thursday, 11/12
  • Next by Date: Re: programatically updating UI for NSArrayContoller/NSTableView combo
  • Previous by thread: Re: if statement causing 32 Byte leak?
  • Next by thread: Re: if statement causing 32 Byte leak?
  • Index(es):
    • Date
    • Thread