• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: static analyzers says I'm leaking, I _think_ I'm not
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >static analyzers says I'm leaking, I _think_ I'm not (From: Michael David Crawford <email@hidden>)
 >Re: static analyzers says I'm leaking, I _think_ I'm not (From: Daniel Höpfl <email@hidden>)
 >Re: static analyzers says I'm leaking, I _think_ I'm not (From: Charles Srstka <email@hidden>)
 >Re: static analyzers says I'm leaking, I _think_ I'm not (From: Daniel Höpfl <email@hidden>)

  • Prev by Date: Re: static analyzers says I'm leaking, I _think_ I'm not
  • Next by Date: Re: NSNotification coalescing - which one gets through?
  • Previous by thread: Re: static analyzers says I'm leaking, I _think_ I'm not
  • Next by thread: Does the NSView Drag Protocol has any issues with non-key windows?
  • Index(es):
    • Date
    • Thread