Re: an oldie but a goodie: observing properties of collected objects
Re: an oldie but a goodie: observing properties of collected objects
- Subject: Re: an oldie but a goodie: observing properties of collected objects
- From: Jerry Krinock <email@hidden>
- Date: Thu, 17 Jun 2010 18:07:47 -0700
On 2010 Jun 17, at 15:33, Ken Thomases wrote:
> Where's the difficulty, again?
I was going to ask what happens if this object which owns 5000 widget objects gets deallocated. Their observers have not been removed and I would expect nastygrams like this [1]. But then I noticed that your observer is 'self'.
Ken, is that part of your scheme, that the observer of the collection must also be the owner of the collection?
If so, since the objects will be deallocated slightly before the owner is, there is a small window of time where it's observing a deallocated object. Do you worry about that?
Or does garbage collection somehow take care of removing observers? (I don't know much about GC.)
Jerry
[1] 10/06/13 21:32:18 Test[81006] An instance 0x1653cb0 of class Ixterno was deallocated while key value observers were still registered with it. Observation info was leaked, and may even become mistakenly attached to some other object. Set a breakpoint on NSKVODeallocateBreak to stop here in the debugger...
_______________________________________________
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