• 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: Memory management question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Memory management question


  • Subject: Re: Memory management question
  • From: Alastair Houghton <email@hidden>
  • Date: Wed, 24 Mar 2004 23:20:57 +0000

On 24 Mar 2004, at 22:32, Ondra Cada wrote:

> Nevertheless, I take it you are well aware of this part of the
> argument too, and am writing this message actually just for the
> benefit of other readers (who are truly invited to check the archives,
> where all the arguments of both sides are stated--many times over ;)

Indeed. That's why I put a link to the archives in my previous message.

[snip]

> and wherever there is the slightest suspicion the (*) code may,
> whatever indirectly or in future releases, cause the setter to be
> called, one should always use the safe pattern
>
> id o=[[[foo getter] retain] autorelease];
> // any code here
> // o used now

or

id o = [[foo getter] retain];
// code here
// o used now
[o release];

which avoids an unnecessary autorelease :-)

Kind regards,

Alastair.

--
http://www.alastairs-place.net

[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: Memory management question
      • From: Ondra Cada <email@hidden>
References: 
 >Re: Memory management question (From: Ondra Cada <email@hidden>)

  • Prev by Date: Re: Memory management question
  • Next by Date: Re: [ANN] Shovel - Third-Party "Software Update"
  • Previous by thread: Re: Memory management question
  • Next by thread: Re: Memory management question
  • Index(es):
    • Date
    • Thread