Re: How to find an over-released object?
Re: How to find an over-released object?
- Subject: Re: How to find an over-released object?
- From: "M. Uli Kusterer" <email@hidden>
- Date: Sat, 18 Jun 2005 20:56:27 +0200
At 16:44 Uhr +0200 18.06.2005, Stéphane Sudre wrote:
The main problem is that i can't find which
object the autorelease pool tries to release so
i can't fix the problem.
NSZombieEnabled can be used to track releasing on already released object.
http://www.cocoadev.com/index.pl?NSZombieEnabled
Another help may be to name your objects. For
instance, I wrote a UKDebugNameFor() function
that I use whenever I need to NSLog() an object.
It assigns each object a name from a list. You
can just call it whenever you create an object of
the type causing the error.
Then, later, when you hit your memory bug, you
can call UKDebugNameFor() from GDB and it'll tell
you the object's name, and then you'll at least
know what line of code created the object that is
being overreleased, which I've had problems with
in some cases.
Of course, this would be easier if we had one of
those fancy "rewindable" debuggers that let you
step backwards through your program... :-)
PS - You can find the files needed to use UKDebugName at:
http://witness.is-a-geek.org:8800/trunk/UliKit/UKDebugNames.h
http://witness.is-a-geek.org:8800/trunk/UliKit/UKDebugNames.m
http://witness.is-a-geek.org:8800/trunk/UliKit/English.lproj/UKDebugNames.plist
--
Cheers,
M. Uli Kusterer
------------------------------------------------------------
"The Witnesses of TeachText are everywhere..."
http://www.zathras.de
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden