• 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: Instruments leaks.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Instruments leaks.


  • Subject: Re: Instruments leaks.
  • From: "Michael Ash" <email@hidden>
  • Date: Sun, 12 Oct 2008 17:50:17 -0400

On Sun, Oct 12, 2008 at 12:08 PM, Fritz Anderson
<email@hidden> wrote:
> On 12 Oct 2008, at 10:00 AM, Sandro Noel wrote:
>
>> but i wonder, will the variable automatically be released when it falls
>> out of scope? i don't think so but i  might be wrong.
>> i'll have to look it up in the doc again :)
>
> No. It will not be automatically released, unless you use garbage collection

Note that this is not the case. It will be automatically
*deallocated*, but it will not be automatically released.

This is kind of pedantic, but I think it's important. In the context
of Cocoa, "release" means to decrement the reference count. It does
*not* mean to deallocate the object. (Although deallocation is
sometimes a consequence.) I think this is important because one of the
most common errors I see Cocoa newbies making is confusing "release"
with "dealloc". They are very different and the two terms and methods
are not interchangeable.

I know what you meant, but just for the sake of accuracy, I wanted to
point out the above.

Mike
_______________________________________________

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

References: 
 >Instruments leaks. (From: Sandro Noel <email@hidden>)
 >Re: Instruments leaks. (From: j o a r <email@hidden>)
 >Re: Instruments leaks. (From: Sandro Noel <email@hidden>)
 >Re: Instruments leaks. (From: j o a r <email@hidden>)
 >Re: Instruments leaks. (From: Sandro Noel <email@hidden>)
 >Re: Instruments leaks. (From: Fritz Anderson <email@hidden>)
 >Re: Instruments leaks. (From: Sandro Noel <email@hidden>)
 >Re: Instruments leaks. (From: Fritz Anderson <email@hidden>)

  • Prev by Date: Re: Add animation layer and then remove animation layer
  • Next by Date: Remote debugging - Could not open socket: /tmp/.XcodeGDBRemote-3439-0
  • Previous by thread: Re: Instruments leaks.
  • Next by thread: Read-only properties
  • Index(es):
    • Date
    • Thread