diff -r cb9cdf247239 -r b3254a2f6d6c TCP/TCPConnection.m --- a/TCP/TCPConnection.m Wed Apr 22 16:45:39 2009 -0700 +++ b/TCP/TCPConnection.m Wed Apr 29 13:57:10 2009 -0700 @@ -111,14 +111,16 @@ CFWriteStreamRef writeStream = NULL; CFStreamCreatePairWithSocket(kCFAllocatorDefault, socket, &readStream, &writeStream); self = [self _initWithAddress: [IPAddress addressOfSocket: socket] - inputStream: (NSInputStream*)readStream - outputStream: (NSOutputStream*)writeStream]; + inputStream: (NSInputStream*)CFMakeCollectable(readStream) + outputStream: (NSOutputStream*)CFMakeCollectable(writeStream)]; if( self ) { _isIncoming = YES; _server = [listener retain]; CFReadStreamSetProperty(readStream, kCFStreamPropertyShouldCloseNativeSocket, kCFBooleanTrue); CFWriteStreamSetProperty(writeStream, kCFStreamPropertyShouldCloseNativeSocket, kCFBooleanTrue); } + if(readStream) CFRelease(readStream); + if(writeStream) CFRelease(writeStream); return self; }