On Fri, Mar 21, 2008 at 4:32 PM, Stuart Malin <[EMAIL PROTECTED]> 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--
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to