Re: Why does this keep sending EXC_BAD_ACCESS
Re: Why does this keep sending EXC_BAD_ACCESS
- Subject: Re: Why does this keep sending EXC_BAD_ACCESS
- From: Angel Caban <email@hidden>
- Date: Tue, 30 Mar 2004 12:36:57 -0500
By assigning an autoreleased object do you mean something like this:
- (id)init
{
self = [super init];
if(self) {
serverWindows = [[NSMutableArray arrayWithCapacity:5] autorelease];
channelWindows = [[NSMutableArray arrayWithCapacity:15] autorelease];
[serverWindows retain];
[channelWindows retain];
}
return self;
}
On Mar 30, 2004, at 12:19 PM, j o a r wrote:
>
The serverWindows array has almost certainly been released. Do you
>
assign an autoreleased object to that instance variable?
>
>
j o a r
>
>
On 2004-03-30, at 18.37, Angel Caban wrote:
>
>
> This is the code snippet:
>
>
>
> 1 - (void)createServerWindowWithServer:(Server *)server
>
> 2 {
>
> 3 ServerWindowController *servWin;
>
> 4 NSWindowController *win;
>
> 5
>
> 6 // First, look for a clean server window
>
> 7 NSEnumerator *enumerator = [serverWindows objectEnumerator];
>
> 8 while(win = (NSWindowController *)[enumerator nextObject]) {
>
> 9 // The first clean window is ours
>
> 10 NSString *title = [[win window] title];
>
> 11 if([title isEqualToString:@"Server"]) {
>
> 12 servWin = (ServerWindowController *)win;
>
> 13
>
> 14 // Clean Server Window
>
> 15 [[servWin window] setTitle:(data->hostName)];
>
> 16 [servWin setServer:server];
>
> 17
>
> 18 break;
>
> 19 }
>
> 20 }
>
> ...
>
>
>
> The program crashes at line 7. With an EXC_BAD_ACCESS.
>
> serverWindows is an initialized NSMutableArray.
>
> The crash comes from objc_msgSend
>
> usually +0012 lwz r12,32(r12)
>
> or +0020 lwz r11,0(r12)
>
>
>
> Why would this happen?
>
>
[demime 0.98b removed an attachment of type
>
application/pkcs7-signature which had a name of smime.p7s]
>
_______________________________________________
>
cocoa-dev mailing list | email@hidden
>
Help/Unsubscribe/Archives:
>
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
>
Do not post admin requests to the list. They will be ignored.
--
Angel Caban
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.