Re: Mysterious crash with NSTableView
Re: Mysterious crash with NSTableView
- Subject: Re: Mysterious crash with NSTableView
- From: Andreas Falkenhahn <email@hidden>
- Date: Fri, 26 Aug 2016 20:39:03 +0200
On 26.08.2016 at 20:12 Kyle Sluder wrote:
> On Fri, Aug 26, 2016, at 12:25 PM, Gary L. Wade wrote:
>> I'm talking about exchanging release for autorelease on your list
>> delegate, which happens after runModal finishes. Since you now do an
>> orderOut, your table view should not need its data source/delegate, so it
>> should be safe keeping them set and using an autorelease, but clearing
>> them is the safest.
> Neither autorelease nor release on its own is sufficient here; Andreas
> should clear out his delegates.
So should I also clear the button delegates or is NSTableView an exception
here?
Side note:
What I find really weird in this whole thing is the fact that it crashed
although the delegates are clearly released *after* the window. I wouldn't
be surprised to get crashes if I released the delegates *before* the window.
That would be natural behaviour but from a logical point of view it's really
weird to see it crash with the delegate/data source being released *after*
the window, i.e. when one would expect NSTableView to have been fully deallocated
already.
From a logical point of view I'd expect this call
[win release];
to kill off the NSTableView and its associates completely. So I'd consider
it safe to release the delegate/data source after that, but apparently they
need to be cleared out before. It's good to know but from a logical point
of view I still think it's weird. I mean, who the heck is referencing those
delegates after the call to [win release]? Everything should be gone by
that call but there's probably some advanced wizardry going on that I'm
unaware of.
--
Best regards,
Andreas Falkenhahn mailto:email@hidden
_______________________________________________
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