Re: In-loop releasing of objects does not free memory?
Re: In-loop releasing of objects does not free memory?
- Subject: Re: In-loop releasing of objects does not free memory?
- From: "Shawn Erickson" <email@hidden>
- Date: Wed, 13 Feb 2008 08:57:54 -0800
On Feb 12, 2008 5:10 PM, John Terranova <email@hidden> wrote:
> I guess I should have been more explicit and said to, first, verify
> that retainCount > 1 with this type of NSLog(). Then, investigate why
> retainCount > 1. If it is an autorelease, then "try wrapping the body
> of the loop in an autorelease pool," if that is your chosen solution.
> If there are no autoreleases (or not enough to account for the
> retainCount), then you must "find" your missing auto/release to patch
> the real leak.
You assume the object accumulating is one that you can query the
retainCount of. It could be something created by the framework in
response to -[NSString initWithContentsOfFile:].
IMHO it seldom a good idea to query and log retain counts in this way
(it can easily mislead) instead use tools like ObjectAlloc and now
Instruments to understand what is taking place.
-Shawn
_______________________________________________
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