To move beyond the memory leaks in an untouched version of EchoClient, the only thing you need to do is remove the retain calls in openStreams. The call to -[NSNetService getInputStream:outputStream:] calls CFStreamCreatePairWithSocketToNetService, which is a "create" function.
To verify this, the memory leak will be exacerbated every time you select and deselect a service. >> > >Hello, > >> The retains in -openStreams are balanced by the releases in - >> closeStreams. Similarly, the streams are retained/released in a >> balanced fashion within the server. So, unless the server is never >> shutting down, that isn't the source of your leak -- there must be >> an unbalanced -retain coming from somewhere. >> >> The Leaks instrument can tell you where all -retain/-releases were >> invoked from. You should see an unbalanced -retain. > >So I think now I got it, for example if there is a line 48 there >should be another line -48, right? Then it's balanced, and it's not >necessarily the last line? > >There are several leaks, and I think one unbalanced part should then >be getinputstream:outputstream:, and -openstreams: Simply deleting the >two retain lines in the openstreams: didn't work... > >Jens _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]