Re: One Shot Windows: WARNING
Re: One Shot Windows: WARNING
- Subject: Re: One Shot Windows: WARNING
- From: Matt Neuburg <email@hidden>
- Date: Tue, 10 Feb 2009 15:12:18 -0800
- Thread-topic: One Shot Windows: WARNING
On Tue, 10 Feb 2009 13:30:52 -0500, Michael Ash <email@hidden>
said:
>Connected it in the nib, then implemented -dealloc:
>
>- (void)dealloc
>{
> [tv setDataSource: nil];
> [super dealloc];
>}
>
>Crash went away, again exactly as predicted.
>
>The problem is simply that the one shot setting ends up making the
>table view message its data source late in the game, after the data
>source has been destroyed. This dangling pointer leads to a crash.
>Tying up the dangling pointer by disconnecting the data source fixes
>the crash. This is to be expected because, as I discussed, the order
>of object destruction is not well defined in this case, so all weak
>references need to be disconnected.
Yup, you're right, I'm wrong. My initial discomfort with Seth's explanation
was because I felt that the "One Shot" setting shouldn't make this kind of
difference. With this dealloc, it doesn't. That's what I was after. Thanks!
m.
--
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
http://www.tidbits.com/matt/default.html#applescriptthings
_______________________________________________
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