• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Debugging object lifetimes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Debugging object lifetimes
      • From: j o a r <email@hidden>
References: 
 >Re: Debugging object lifetimes (From: Joseph Heck <email@hidden>)

  • Prev by Date: Re: is nullify causing an exception
  • Next by Date: Re: Debugging object lifetimes
  • Previous by thread: Re: Debugging object lifetimes
  • Next by thread: Re: Debugging object lifetimes
  • Index(es):
    • Date
    • Thread