# HG changeset patch # User Jens Alfke # Date 1213896139 25200 # Node ID 70590cc555aa1d50bede59b37f7146008e30a849 # Parent 6f608b552b77b81fbe21cec8fea2b04cda3bc504 Work around crash-on-close by temporarily retaining the connection object. diff -r 6f608b552b77 -r 70590cc555aa TCP/TCPConnection.m --- a/TCP/TCPConnection.m Wed Jun 11 14:58:38 2008 -0700 +++ b/TCP/TCPConnection.m Thu Jun 19 10:22:19 2008 -0700 @@ -264,6 +264,7 @@ // called by my streams when they close (after my -close is called) - (void) _closed { + [[self retain] autorelease]; if( _status != kTCP_Closed && _status != kTCP_Disconnected ) { LogTo(TCP,@"%@ is now closed",self); TCPConnectionStatus prevStatus = _status; @@ -352,6 +353,7 @@ { LogTo(TCP,@"%@ got %@ on %@",self,error,stream.class); Assert(error); + [[self retain] autorelease]; setObj(&_error,error); [_reader disconnect]; setObj(&_reader,nil);