Re: NSConnection crashes
Re: NSConnection crashes
- Subject: Re: NSConnection crashes
- From: "Jim Thomason" <email@hidden>
- Date: Fri, 26 May 2006 08:35:32 -0500
D'oh. I figured it out for myself, just took some more research. I'm
sure there's some internet law about how you'll figure out the answer
to an unsolvable problem yourself within 24 hours of requesting help
from a mailing list.
And I'm sure I was right - it was too vague to be able get any real
help. The key piece of information that was omitted was that the
connection was made on a separate thread that was ending.
The connection got retained once, but then released when the thread
ended and its pool was released.
So that's where my extra release was coming from, and the extra retain
is the correct solution.
Mystery solved.
-Jim......
On 5/25/06, Jim Thomason <email@hidden> wrote:
I'm probably being too vague to get any real help, but I'm going to
try anyway since I'm stumped.
I have a client & server set up using DO. They connect and chat just
fine. The problem is that if the server is shut down while the client
is connected, the client crashes.
The only information I'm getting out of GDB is down at the assembly
level in NSConnection where it's griping about a CFDictionary value.
I can't seem to pinpoint where in my code I'm goofing something up. I
have managed to narrow down that if I give the NSConnection object 2
retains in my client code, then it works fine.
My connection code is fairly simple:
NSConnection* theConnection = [NSConnection
connectionWithReceivePort:thePort sendPort:nil];
[thePort release];
[self setConnection:theConnection];
-(void) setConnection:(NSConnection*) newConnection {
[newConnection retain];
[connection release];
connection = newConnection;
}
At some point in there, it seems like my NSConnection object is
picking up an additional release or autorelase or whathaveyou, but I
don't see anything that could be causing that message.
Is there anything internal I should know about that would cause it?
Otherwise, any one have any pointers for tracking this down? After 3
days on it, I'm stumped.
Thanks,
-Jim...
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden