Local Proxy problem
Local Proxy problem
- Subject: Local Proxy problem
- From: email@hidden (mikevannorsdel)
- Date: Thu, 06 Dec 2001 19:43:00 -0700
In NSConnection's delegate method connection:shouldMakeNewConnection:, I get
the rootProxy for the new connection to get some pre-setup info from the
remote object. The the setup is successful, then I return YES to finish the
connection. But I'm running into a problem. When the remote side of the
connection dies, I get an error "XXX connection c1f20 still has 1 local
proxies". Now all the other connections which die don't have this problem.
I think I'm getting this problem because I'm getting the root proxy of the
new connection and this is somehow creating a local proxy that's not being
cleaned up. Is this right? How do I clean up this local proxy when I'm
done? I don't plan on keeping the proxy outside of the
connection:shouldMakeNewConnection: method. Here's a brief summary:
- (BOOL)connection:(NSConnection*)parentConnection
shouldMakeNewConnection:(NSConnection*)newConnection
{
id Proxy = [newConnection rootProxy];
//do setup
if(setup)
return YES;
else
return NO;
}
I've also tried wrapping an autoreleasepool around this so that any
autoreleased objects would be cleaned up at the end of the method. But that
didn't help. How do I clean up the local proxy so I don't get the error and
seg fault?