Re: After Autoreleasing Still Getting Leaked
Re: After Autoreleasing Still Getting Leaked
- Subject: Re: After Autoreleasing Still Getting Leaked
- From: Jens Alfke <email@hidden>
- Date: Wed, 15 Jun 2011 12:39:38 -0700
On Jun 15, 2011, at 12:34 PM, Bing Li wrote:
> Yes, TCP has the boundary issue. So I put a "\n" at the end of each XML. And there is no "\n" within any XML.
That has nothing to do with the issue of UTF-8 sequences being split across reads.
In UTF-8, non-ASCII characters are represented as multi-byte sequences (where each byte has the high bit set.) If the message is broken into packets such that one packet ends partway through such a sequence and the next packet begins with the rest of it, then neither packet’s contents will be parseable by itself as UTF-8 and the NSStrings you get will be nil. So you’ll lose data.
> However, it should not be the reason to cause memory leaks, right?
No, but it sounds like your code has bigger problems than memory leaks, so you probably shouldn’t worry about those yet. (And I believe we’ve already told you what you need to know about tracking down the leaks.)
—Jens
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden