[cfe-dev] [PATCH] Check missing or extra releases of ivars in dealloc

Thomas Clement thomascl at free.fr
Wed Oct 29 06:20:38 PDT 2008


On Oct 29, 2008, at 5:32 AM, Ted Kremenek wrote:

> On Oct 24, 2008, at 8:17 AM, Nikita Zhuk wrote:
>
>> Hi,
>>
>> The attached patch adds additional checks to -warn-objc-missing-
>> dealloc. It checks that all ivars which are used in implementation
>> of synthesized properties are either
>> a) released in dealloc if the property has retain" or "copy"
>> attribute OR
>> b) not released in dealloc if the property has "assign" attribute
>>
>> If it looks useful to you, please review & include it into clang.
>>
>>
>
> Hi Nikita,
>
> Other than adding a "bug category" for these warnings, I basically
> applied the patch as is:
>
>   http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20081027/008677.html
>
> We will continue to evolve the -dealloc checks over time, and this is
> a great addition!

Also classes with only 'assigned' properties should not be flagged as  
missing a dealloc method.
I filled a bug report about that a few days ago (2956).

Regards,
Thomas




More information about the cfe-dev mailing list