Re: Why does this leak memory?
Re: Why does this leak memory?
- Subject: Re: Why does this leak memory?
- From: j o a r <email@hidden>
- Date: Mon, 11 Jul 2005 08:36:53 +0200
No, no, no... A simple accessor method should of course not retain
the value before it's being returned. You're just hiding an error
further down stream where the returned object is released one time
too many.
j o a r
On 11 jul 2005, at 08.28, Matt Ball wrote:
I think I may be on to something...
I changed:
- (NSImage *)image
{
return [[image retain] autorelease];
}
to
- (NSImage *)image
{
return [image retain];
}
and it seems to be working better. I now have only 6 leaks as opposed
to > 150. I don't know if this helps the situation at all, but I
thought I'd let you know. Let me know if this triggers a Eureka moment
:)
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden