Skip navigation.
 
mlRe: stumped with sigbus
FROM : Christoph Nadig
DATE : Mon Nov 29 23:22:07 2004

Hello Jim,

>The order of events to cause it are:
>1) launch program.
>2) new document prompts for parameters (required to make document)
>3) cancel document (don't create one)
>4) document deallocates, panel window controller deallocates, data
>source deallocates (I'm logging inside these methods so I see it
>happen)
>5) datasource gets the tableView:objectValueForTableColumn:row:
>message, and the whole works goes down because the datasource no
>longer exists.


I've seen this too with both table views and outline views, and it seems
that the panel is not released but autoreleased when the controller is
deallocated, therefore the panel is still valid until the next time the
run loop is passed - if another event is received that causes the panel
to redraw/update, it tries to access the data source.

What I found to fix the problem is to detach the data source and
delegates from
the table view before deallocating the panel controller, for example in the
panel controller (or whetever your window delegate is):

- (void)windowWillClose:(NSNotification *)aNotification
{
    // disconnect the outline view
    [outlineView setDelegate:nil];
    [outlineView setDataSource:nil];   
}


Hope this helps,
Christoph

Related mailsAuthorDate
mlstumped with sigbus Jim Thomason Nov 29, 22:03
mlRe: stumped with sigbus Christoph Nadig Nov 29, 23:22
mlRe: stumped with sigbus Jim Thomason Nov 29, 23:52