Re: Analyser reports memory leak… where?
Re: Analyser reports memory leak… where?
- Subject: Re: Analyser reports memory leak… where?
- From: Graham Cox <email@hidden>
- Date: Thu, 12 Sep 2013 18:17:17 +0200
On 12/09/2013, at 6:07 PM, Kyle Sluder <email@hidden> wrote:
> Personally, I would avoid doing this, as it could cause reentrancy among
> KVO observers of eventTypes. Instead, I'd assign to mEventTypes directly
> from your lazy initializer. Or perhaps I would factor out the common
> setter code to a private helper method.
Indeed, I have changed the code to do just this, which is what I would have written in the first place (honest!). I'm not sure why it wasn't and changing it appears to have not caused any problems.
> Hopefully this has the side effect of shutting the analyzer up.
It does.
I guess the thread is now really about why the analyser was thrown off by this. Academic? Perhaps, but here's the bigger picture: I want to gradually move my codebase to ARC, so in preparation for that, I have been going through and trying to ensure the analyser is happy, since my understanding is that ARC relies on the same analysis to do its thing correctly, so if the analyser is getting it wrong, converting to ARC might introduce a bug here.
--Graham
_______________________________________________
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