Re: Debugging object lifetimes
Re: Debugging object lifetimes
- Subject: Re: Debugging object lifetimes
- From: Scott Ribe <email@hidden>
- Date: Wed, 08 Mar 2006 12:13:09 -0700
- Thread-topic: Debugging object lifetimes
> It's not quite as nice as that method name, but I recommend you check
> out NSZombieEnabled.
Thanks. I actually figured it out before trying that, I saw that my
retain/release calls really did appear to be balanced and got sidetracked by
the realization that I had slipped a few Cocoa calls into a low-level
background thread without ever initializing Cocoa threading. Then when that
didn't fix the problem, I suddenly saw it:
In a bg thread where I should have been creating a new NSInvocation for each
call, because they get passed on to the main thread, I was instead reusing
one and just changing the parameters. So sometimes the bg thread would set
new parameters before the fg thread had picked up the prior ones. The first
parameters would never get a release call, and the second set would be
released twice. That's not even mentioning the potential for mischief if the
bg thread happened to change out the parameters in the middle of the fg
thread calling invoke...
However, I am sure I will need NSZombieEnabled at some point...
--
Scott Ribe
email@hidden
http://www.killerbytes.com/
(303) 722-0567 voice
_______________________________________________
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