Re: finding memory leaks
Re: finding memory leaks
- Subject: Re: finding memory leaks
- From: Brian Christensen <email@hidden>
- Date: Mon, 11 Feb 2008 09:45:33 -0500
On Feb 11, 2008, at 09:25, Torsten Curdt wrote:
For this snippet there is nothing that should live on after the
blocks has finished. So no "retain" and things should be quite
straight forward. With the NSAutoreleasePool I just find it hard to
find out what needs to the "autorelease"'d and what not. ("alloc",
"new" etc are already covered - I know) But somehow I am still
failing according to "leaks".
It looks like you're leaking leaking your "queries" NSMutableArray.
The autorelease pool you established is only responsible for cleaning
up autoreleased objects, so you need to add in a "[queries release]"
statement somewhere (or use "queries = [NSMutableArray array]" instead).
You also shouldn't be autoreleasing the result of the
"searchElementForProperty" messages. This method is (by convention)
already returning an autoreleased object.
/brian
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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