Re: KVO persists too long
Re: KVO persists too long
- Subject: Re: KVO persists too long
- From: Fritz Anderson <email@hidden>
- Date: Sat, 30 Jun 2007 18:23:28 -0500
On 30 Jun 2007, at 5:26 PM, Jim Thomason wrote:
You'll note that it's trying to call observeValueForKeyPath on an
NSDecimalNumber in this case. So I'm assuming that the original
observationforwarder has been removed and the memory address
recycle to a
decimal number, which in turn fails.
2) It'll crash because the observation forwarder is wiped out and
there's
nothing put back into that memory slot.
3) It'll crash when trying to remove the observer.
To emphasize, I'm not adding any observers myself, these are just the
observers added by the system. And my current speculation is that
they're
not always getting removed when they're supposed to, but I'm just
grasping
at straws.
Assume, because life is that way, that this was caused by something
in your control, like overreleasing an object.
Setting the environment variable NSZombieEnabled to 1 will, instead
of recycling the memory allocated to a released object, fill it with
a sentinel object (NSZombie) that remembers the class of the original
object. It will throw an exception when an attempt is made to access
it. This would tell you what kind of object got overreleased, and
will probably catch the error closer to its making than that ignored
exception.
Remember also to break on -[NSException raise].
This won't catch everything (objects bridged to Core Foundation won't
get zombie service), but it will help.
— F
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden