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

Re: Solving memory leaks


  • Subject: Re: Solving memory leaks
  • From: mmalc Crawford <email@hidden>
  • Date: Sun, 28 Mar 2010 11:08:42 -0700

On Mar 28, 2010, at 11:03 am, Philip Mobley wrote:

> When calling setFields, you are then responsible for releasing the "newFields" NSMutableArray you created in your sample code, because [newFields mutableCopy] increments the ref counter.
>
This is not correct.

[newFields mutableCopy] returns a new object that you own, it does not "increment the ref count".
You must relinquish ownership of the previous value because you're about to take possession of a new value.

mmalc

_______________________________________________

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: 
 >Solving memory leaks (From: Michael Davey <email@hidden>)
 >Solving memory leaks (From: Michael Davey <email@hidden>)
 >Re: Solving memory leaks (From: mmalc Crawford <email@hidden>)
 >Re: Solving memory leaks (From: Philip Mobley <email@hidden>)

  • Prev by Date: Re: Solving memory leaks
  • Next by Date: Creating WebView in code
  • Previous by thread: Re: Solving memory leaks
  • Next by thread: Re: Solving memory leaks
  • Index(es):
    • Date
    • Thread