Re: Autoreleasepool problems
Re: Autoreleasepool problems
- Subject: Re: Autoreleasepool problems
- From: "Shawn Erickson" <email@hidden>
- Date: Wed, 19 Jul 2006 11:11:50 -0700
On 7/19/06, Kay Roepke <email@hidden> wrote:
Hi *!
I'm totally stumped here. I have a parser framework and simple shell
tool which uses the framework to parse some sample input text for
testing.
What happens is this:
In main() I create an autorelease pool and call my parser. After
lexing & parsing the input correctly, I release the pool as the last
thing in main().
The release fails (this is with NSDebugEnabled=YES,
NSAutoreleaseFreedObjectCheckEnabled=YES):
LL-star[4339] *** _NSAutoreleaseFreedObject(): release of previously
deallocated object (0x30c7d0) ignored
At this point there should only by NSCF* objects in the pool. But in
addition there are two entries of my own object there, which I
positively have notautoreleased myself. I do not call autorelease
anywhere in my code.
If you call any code from the Cocoa framework (etc.) code in the
framework may send a retain following at some point by a release or
autorelease. In other words even you don't send an object an
autorelease some framework code may send it an autorelease message.
I think you are attacking the issue in the wrong way... don't attempt
to peer into autorelease pools or retain counts because you have poor
visibility of what framework code does.
Instead try to understand exactly which object is being over released
and look at that objects life time in code and by using things like
ObjectAlloc.app. Make sure to enable NSZombie support as well.
Also recall that the same address in memory can be reused so if you
have a stale pointer (which easily happens if you over release
something) then the pointer can end up pointer at an unrelated
object... which can confuse you attempts to debug things (NSZombie can
help with that).
-Shawn
_______________________________________________
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