• 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: autorelease pool
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: autorelease pool


  • Subject: Re: autorelease pool
  • From: Gregory Weston <email@hidden>
  • Date: Tue, 23 Oct 2007 15:52:15 -0400

Erfan Aleemullah wrote:

Yes, I am trying to figure out whether or not I need to use the release pool
and was throwing the above code out as an example - what I wanted to know is
**do I need the autorelease pool if the retain count is 1 after the command
[myObject release]; *
I need to deallocate memory in my program and release alone isn't taking the
retain count to 0

Ignore the retain count. It's an implementation detail that's not reliably useful for what you're trying to get out of it.


Adding an autorelease pool isn't going to do anything magic, and the only way you should ever _need_ to add one (although they can optionally be introduced to improve resource utilization) is if you see a logged message that an object was autoreleased without a pool in place.


_______________________________________________

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


  • Prev by Date: Re: autorelease pool
  • Next by Date: Re: Posting keyboard repeat events
  • Previous by thread: Re: autorelease pool
  • Next by thread: Re: autorelease pool
  • Index(es):
    • Date
    • Thread