On Nov 1, 2009, at 1:30 PM, Markus Spoettl wrote:
The documentation doesn't back this assertion, neither does the header comment in NSNetServices.h. According to the memory management rules the method should return autoreleased streams.
Yes; but that doesn't necessarily mean the streams will go away soon if you don't retain them. An NSStream object is usually scheduled on a runloop, which keeps a reference to it as long as its open, so I believe it will stay around even if not explicitly retained by the app.
Sure enough the author of the example project believes what he says because the project doesn't retain the streams anywhere.
Does it release the streams? That would be the true test. My belief is that it can get away without retaining them, as long as it never accesses them again after they close; but if it explicitly releases them, it would crash.
That said, I think it's safer to keep your own references to the stream objects by retaining and releasing them.
—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 arch...@mail-archive.com