[cfe-dev] Missing dealloc analysis

Nikita Zhuk nikita at zhuk.fi
Thu Jul 3 10:49:31 PDT 2008


On 3.7.2008, at 20.30, David Chisnall wrote:

> This is especially true when you consider subclassing.  A singleton
> can not guarantee that its subclasses will also be singletons, and so
> should release all of its ivars when it is -dealloc'd, or risk causing
> leaks if it is subclassed.
>
> If a singleton needs to have shared resources that are also shared
> with subclasses then it should store them in file statics, no ivars.

Yes, this is true, so the current "absence of ivars disables dealloc  
check" functionality should work with singletons as well, so no  
special cases needed. My original statement ("e.g. singletons don't  
need dealloc") was incorrect. But anyway, thanks for correction and  
quick implementation of these checks.







More information about the cfe-dev mailing list