Re: Analyser reports memory leak… where?
Re: Analyser reports memory leak… where?
- Subject: Re: Analyser reports memory leak… where?
- From: Graham Cox <email@hidden>
- Date: Thu, 12 Sep 2013 17:37:02 +0200
On 12/09/2013, at 5:27 PM, Steve Mills <email@hidden> wrote:
> It might be that setObject: is not safe if object is the same as _object. The correct way to do this is:
>
> [object retain];
> [_object release];
> _object = object;
Yep, though in the original code a test for equality brackets the assignment (again something I don't usually do unless the setter has side effects).
--Graham
_______________________________________________
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