• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: After Autoreleasing Still Getting Leaked
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: After Autoreleasing Still Getting Leaked
      • From: Bing Li <email@hidden>
References: 
 >After Autoreleasing Still Getting Leaked (From: Bing Li <email@hidden>)
 >Re: After Autoreleasing Still Getting Leaked (From: Scott Ribe <email@hidden>)
 >Re: After Autoreleasing Still Getting Leaked (From: Bing Li <email@hidden>)
 >Re: After Autoreleasing Still Getting Leaked (From: Scott Ribe <email@hidden>)
 >Re: After Autoreleasing Still Getting Leaked (From: Jens Alfke <email@hidden>)
 >Re: After Autoreleasing Still Getting Leaked (From: Scott Ribe <email@hidden>)
 >Re: After Autoreleasing Still Getting Leaked (From: Bing Li <email@hidden>)
 >Re: After Autoreleasing Still Getting Leaked (From: Scott Ribe <email@hidden>)
 >Re: After Autoreleasing Still Getting Leaked (From: Bing Li <email@hidden>)

  • Prev by Date: Re: After Autoreleasing Still Getting Leaked
  • Next by Date: Re: Interface item validation through first responder
  • Previous by thread: Re: After Autoreleasing Still Getting Leaked
  • Next by thread: Re: After Autoreleasing Still Getting Leaked
  • Index(es):
    • Date
    • Thread