Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: autorelease pool



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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.