Re: Impossible leak warning in OS X init method
Re: Impossible leak warning in OS X init method
- Subject: Re: Impossible leak warning in OS X init method
- From: Bill Cheeseman <email@hidden>
- Date: Sun, 30 Aug 2015 06:32:21 -0400
> On Aug 29, 2015, at 6:18 PM, Marek Hrušovský <email@hidden> wrote:
>
> Aren't you calling a function "do_stuff_successfully" in your initializer?
> Maybe you named your method/function with special prefix like "new", "create", "alloc"
No, that term was abstracted to state the problem in its simplest form. The actual test was 'if (uiElementRef != NULL)', so the issue was not triggered by accidentally naming a function in a way that might confuse the compiler. The warning path in the static analyzer skips that branch and goes to the false branch where I marked the error.
The code I posted is highly simplified from the original, which may appear here if the administrator approves my long message. Jens has looked at the original code and doesn't see an error.
There is a lot of Core Foundation code in the original. Is anybody aware of circumstances where Core Foundation confuses the static analyzer?
--
Bill Cheeseman - email@hidden
_______________________________________________
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