Re: crash on command-W
Re: crash on command-W
- Subject: Re: crash on command-W
- From: "James W. Walker" <email@hidden>
- Date: Mon, 9 Jun 2008 23:17:21 -0700
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.)
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:
I'm getting an access violation (inside NSTableView) when I close
a window by command-W but not when I close it by clicking the
close widget. I don't understand why it would make a difference.
I have a nib containing a window and an NSWindowController
subclass. It's not a document-based app, but there can be
multiple instances of the window and its controller. In order to
try to get the controller to be released when the window is
closed, I put [self release] in a windowWillClose delegate method.
The window contains an NSTableView. The crash happens if I open
the window, click on a row of the table, and type command-w. If
I just open the window and command-w, no crash.
Anyone have a clue for me?
Almost certainly a memory management error in your data source.
Have you tried the NSZombieEnabled song-and-dance yet?
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.
Tech Note 2124 says: "You can use GDB to set a breakpoint on -
[_NSZombie methodSignatureForSelector:] to further debug this sort
of problem." I tried pasting methodSignatureForSelector: into the
breakpoints window, and it gave me a choice of a dozen or so
classes containing such a method, none mentioning zombies. Is this
Tech Note out of date, perhaps?
I find that when I replace the [self release] by [self autorelease]
in the windowWillClose method, and it seems to fix the problem... I
just wish I understood why.
_______________________________________________
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