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 17:11:31 +0200
On 12/09/2013, at 5:00 PM, Bill Cheeseman <email@hidden> wrote:
> Fix the name and the Analyzer is happy. No need to change the code, because the code is correct
Except that 'fixing' the name would make the code incorrect, because then it isn't a valid getter name.
If you did go ahead and name it thus, the caller would assume that it's their job to release the returned value. If they did that, it would leave mEventTypes dangling, and a later call to -release in -dealloc would crash due to an overrelease. So renaming the method is wrong on both counts.
--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