• 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: Michael David Crawford <email@hidden>
  • Date: Wed, 06 May 2015 14:17:16 -0700

This is 6.2.  I speculated a different diagnostic was a bug; were it
correct, I would have seen that same diagnostic on some other code.

I'll file a radar with a minimal test case if you'd like me to.

I'll download 6.3.1 right now.
Michael David Crawford, Consulting Software Engineer
email@hidden
http://www.warplife.com/mdc/

   Available for Software Development in the Portland, Oregon Metropolitan
Area.


On Wed, May 6, 2015 at 2:12 PM, Greg Parker <email@hidden> wrote:
>
>> On May 6, 2015, at 1:57 PM, Michael David Crawford <email@hidden> wrote:
>>
>> // LifeGrid.h
>> @property (assign, nonatomic) GridCycler *cycler;
>>
>> // Lifegrid.m - init
>> self.cycler = [[GridCycler alloc] initWithGrid: self];  // Potential
>> leak of an object
>> if ( nil == self.cycler ) goto cycler_failed;
>>
>> // dealloc
>> [self.cycler release];
>>
>> Expanding the "potential leak" message yields:
>>
>> 1. assuming 'self' is not nil
>>
>> 2. method returns Objective-C object with +1 retain count
>>
>> 3. Object leaked: allocated object is not references later in this
>> execution path and has a retain count of +1.
>>
>> Isn't that what I want?  I should be taking ownership of it with
>> "alloc/initWithGrid".
>>
>> (initWithGrid doesn't do a cyclic retain.)
>
> Which version of Xcode are you using? The static analyzer in Xcode 6.3 has several bugs in retain count analysis and not all of them are fixed in Xcode 6.3.1.
>
>
> --
> Greg Parker     email@hidden     Runtime Wrangler
>
>
_______________________________________________

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


  • Follow-Ups:
    • Re: static analyzers says I'm leaking, I _think_ I'm not
      • From: Greg Parker <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: Greg Parker <email@hidden>)

  • Prev by Date: Re: static analyzers says I'm leaking, I _think_ I'm not
  • Next by Date: Re: static analyzers says I'm leaking, I _think_ I'm not
  • Previous by thread: Re: static analyzers says I'm leaking, I _think_ I'm not
  • Next by thread: Re: static analyzers says I'm leaking, I _think_ I'm not
  • Index(es):
    • Date
    • Thread