• 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: How to Management Bytes?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to Management Bytes?


  • Subject: Re: How to Management Bytes?
  • From: Scott Ribe <email@hidden>
  • Date: Sun, 19 Jun 2011 10:13:13 -0600

On Jun 19, 2011, at 9:28 AM, Bing Li wrote:

> One more issue is that there was no memory leaking even if I didn't add the
> line, free(receivedBytes). Why?

Because it's stack-allocated, not allocated with any version of malloc. I pointed out the same mistake in my first email to you, yet here you are about a week later having re-introduced the error. Read an introductory book on C. Now. Before you waste any more of your time.

What is the purpose of subLoopPool? There is now nothing in its scope that will cause any objective-C objects to be created, much less autoreleased.

And that copy thing you tried... Seriously? Allocating a a string you own, then copying (& leaking) it, then autoreleasing the copy???

You're just thrashing here, going back and forth between the same set of mistakes with no understanding of what's going on. AS YOU WERE TOLD MULTIPLE TIMES BY MULTIPLE PEOPLE, you had the memory management correct in this function, and were leaking the receivedMessage string elsewhere in your code. Yet here you are days later, still thrashing around with random weird pointless buggy changes to this function.

I had intended not to respond to any more of these messages, but I decided to try one more time. I am now done. I will not try to help you again until you ask a question that demonstrates that you have listened to what you've been told about where your bug is, and have "done your homework" by getting some fundamental understanding of the language you're trying to use.

(And by the way, you are probably nowhere near having a stable program. Based on what you've shown us so far, you should be prepared to be debugging for a while.)

--
Scott Ribe
email@hidden
http://www.elevated-dev.com/
(303) 722-0567 voice




_______________________________________________

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: How to Management Bytes?
      • From: Bing Li <email@hidden>
References: 
 >How to Management Bytes? (From: Bing Li <email@hidden>)

  • Prev by Date: Re: How to Management Bytes?
  • Next by Date: Re: How to Management Bytes?
  • Previous by thread: Re: How to Management Bytes?
  • Next by thread: Re: How to Management Bytes?
  • Index(es):
    • Date
    • Thread