Skip navigation.
 
mlRe: Intercepting retain/release of object
FROM : Sherm Pendley
DATE : Fri Mar 21 22:36:09 2008

On Fri, Mar 21, 2008 at 4:32 PM, Stuart Malin <<email_removed>> wrote:

> Thanks for all the comments. I had started this thread not because I
> wanted to peak under the hood, or employ non-canonical techniques,
> but because I had an instance become free before its time. I had
> though that intercepting -release (and also -retain, why not), would
> allow me to find the place where the extra release came from.



That's basically the kind of mistaken approach to debugging that I was
referring to.

When you find yourself facing an "extra" release, the $64k question is where
in your code are you failing to -retain an object that you will need later.
When your memory management is wrapped up in accessor methods, that becomes
a very simple question to answer.

In short, the fact that you need a means to track down your -retain and
-release calls is indicative of a deeper problem. Examining the retain count
will not only fail to solve that problem, but will also obfuscate the issue
even further. You'd be far better off asking yourself why your -retains and
-releases are so scattered that they're difficult to find and verify in the
first place - that's the *real* problem, not whatever arbitrary value you
happen to get back from -retainCount.

IMHO, of course. :-)

sherm--

Related mailsAuthorDate
mlIntercepting retain/release of object Stuart Malin Mar 19, 18:54
mlRe: Intercepting retain/release of object Jonathan del Strot… Mar 19, 19:04
mlRe: Intercepting retain/release of object Nick Zitzmann Mar 19, 19:04
mlRe: Intercepting retain/release of object Pierre Molinaro Mar 19, 19:09
mlRe: Intercepting retain/release of object Rob Napier Mar 19, 19:12
mlRe: Intercepting retain/release of object Stuart Malin Mar 19, 19:41
mlRe: Intercepting retain/release of object Scott Ribe Mar 21, 19:13
mlRe: Intercepting retain/release of object j o a r Mar 21, 20:38
mlRe: Intercepting retain/release of object Sherm Pendley Mar 21, 21:16
mlRe: Intercepting retain/release of object Stuart Malin Mar 21, 21:32
mlRe: Intercepting retain/release of object Sherm Pendley Mar 21, 22:36
mlRe: Intercepting retain/release of object Erik Buck Mar 21, 23:38
mlRe: Intercepting retain/release of object Jack Repenning Mar 24, 05:31
mlRe: Intercepting retain/release of object Stuart Malin Mar 24, 05:50
mlRe: Intercepting retain/release of object Jack Repenning Mar 24, 17:12