Re: crash on command-W
Re: crash on command-W
- Subject: Re: crash on command-W
- From: "Vijay Malhan" <email@hidden>
- Date: Tue, 10 Jun 2008 22:32:07 +0530
On Tue, Jun 10, 2008 at 7:54 PM, Adam R. Maxwell <email@hidden> wrote:
> On Jun 9, 2008, at 11:17 PM, James W. Walker wrote:
>
> On Jun 9, 2008, at 10:44 PM, Joseph Kelly wrote:
>>
>> Toggle the release when closed setting on the window nib? See the docs
>>> for -[NSWindow setReleasedWhenClosed:]
>>>
>>
>> Tried that, didn't seem to make any difference to the crash. (Right now I
>> have it off, and with the controller autorelease fix, I verified with
>> Instruments that windows aren't leaking.)
>>
>
> I don't think that checkbox has any effect when your window is managed by
> an NSWindowController. See "Window Closing Behavior" here
>
>
> http://developer.apple.com/documentation/Cocoa/Conceptual/WinPanel/Concepts/UsingWindowController.html
>
> On Jun 9, 2008, at 10:30 PM, James W. Walker wrote:
>>>
>>>
>>>> On Jun 9, 2008, at 9:18 PM, Andrew Farmer wrote:
>>>>
>>>> On 09 Jun 08, at 21:03, James W. Walker wrote:
>>>>>
>>>>
>>> OK, I turned on NSZombieEnabled, and now I get this in the log:
>>>>
>>>> *** -[LogController tableView:objectValueForTableColumn:row:]: message
>>>> sent to deallocated instance
>>>>
>>>> That means that the LogController itself has been deallocated, not some
>>>> member that the method uses, right? All this tells me is that somebody is
>>>> trying to draw the table after the controller has been released and the
>>>> window has been hidden if not released. I pretty much knew that already.
>>>>
>>>
> In your windowWillClose method, set the tableview datasource and delegate
> to nil, so it stops messaging your controller. This is a good habit to get
> into with datasource/delegate objects.
Also, you can set the content-view of the window to nil [window
setContentView: nil]; It will ensure to release all the views- including
Table-View, before you send release to your window-controller.
- Vijay
>
>
> --
> adam
>
> _______________________________________________
>
> 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
>
_______________________________________________
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