Re: Memory management question (Correction)
Re: Memory management question (Correction)
- Subject: Re: Memory management question (Correction)
- From: Alastair Houghton <email@hidden>
- Date: Thu, 25 Mar 2004 09:16:33 +0000
(I meant to send this to the list yesterday, but missed the "Reply to
All" button when writing it.)
On 24 Mar 2004, at 22:20, Bjoern Kriews wrote:
>
On 24.03.2004, at 20:14, Alastair Houghton wrote:
>
> pools to clean them up as and when necessary. Alternatively, you can
>
> immediately release any individual autoreleased object by doing
>
>
>
> [[someObject retain] release];
>
>
>
> (The -retain increments the reference count, removing it from the
>
> autorelease pool, then the -release triggers the deallocation of the
>
> object.)
>
>
I find this a little bit disturbing because I was under the impression
>
that a retain/release pair would leave the object in the exact same
>
state regarding memory management.
Apologies, I was incorrect. As was pointed-out by Kurt Revis off-list,
this does not, of course, remove the object from the autorelease pool.
(I was confusing the behaviour of the autorelease mechanism with
something very similar that I wrote myself a while back that solved a
very similar problem.)
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.