Re: static analyzers says I'm leaking, I _think_ I'm not
Re: static analyzers says I'm leaking, I _think_ I'm not
- Subject: Re: static analyzers says I'm leaking, I _think_ I'm not
- From: Charles Srstka <email@hidden>
- Date: Fri, 08 May 2015 03:30:46 -0500
> On May 8, 2015, at 2:43 AM, Daniel Höpfl <email@hidden> wrote:
>
> a)
> @property (assign, nonatomic, readonly) GridCycler *cycler;
>
> init:
> _cycler = [[GridCycler alloc] initWithGrid: self];
>
> dealloc:
> [_cycler release];
Why are we presenting an assign property as the first (and presumably, default) choice? This is incorrect, in my view, even if it technically works; the property is owned by the LifeGrid object, and its declaration should reflect that. Plus, if you remove the “readonly” from the declaration (as in the original example), and a caller changes the property, it will not only leak memory but then crash.
Charles
_______________________________________________
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