Re: Cleaning up weak references ( was Re: Odd Crash when adding table columns manually )
Re: Cleaning up weak references ( was Re: Odd Crash when adding table columns manually )
- Subject: Re: Cleaning up weak references ( was Re: Odd Crash when adding table columns manually )
- From: Andy Lee <email@hidden>
- Date: Thu, 20 Jan 2011 22:03:40 -0500
- Sun-java-system-smtp-warning: Lines longer than SMTP allows found and wrapped.
On Jan 20, 2011, at 8:51 PM, Eric Gorr wrote:
> On Jan 20, 2011, at 4:27 PM, Corbin Dunn wrote:
[...]
>> Yes, please do file a bug. The sample should set the delegate/datasource to nil, as it is good practice to do so, and we can update the sample.
>
> Bug filed: rdar://8896270
I just submitted rdar://8896532, referencing Eric's bug, suggesting that before nilling out the delegate and dataSource, you should check whether they are == self. Conceivably at some point the delegate and/or dataSource might have been set to some other object -- probably not in this example, but in general. Admittedly it's probably very rare that this is an issue, and I'd be surprised if anyone on this list has ever run into a bug because of it. On the other hand, if you're going to program defensively, why not go all the way? On the *other* hand, maybe this is one of those things that should be at the programmer's discretion rather than a hard and fast rule.
--Andy (just now realizing I haven't been checking for == self myself)
_______________________________________________
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