Re: Analyser reports memory leak… where?
Re: Analyser reports memory leak… where?
- Subject: Re: Analyser reports memory leak… where?
- From: Steve Mills <email@hidden>
- Date: Thu, 12 Sep 2013 10:27:39 -0500
On Sep 12, 2013, at 10:19:22, Aaron Montgomery <email@hidden> wrote:
> - (void)setObject:(NSObject *)object
> {
> [_object release];
> _object = [object retain];//3
> }
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;
--
Steve Mills
office: 952-818-3871
home: 952-401-6255
cell: 612-803-6157
_______________________________________________
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