[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: setter/getter discussion
From: |
Pascal Bourguignon |
Subject: |
Re: setter/getter discussion |
Date: |
Tue, 6 Aug 2002 18:46:51 +0200 (CEST) |
> From: Pete French <pete@twisted.org.uk>
> Date: Tue, 06 Aug 2002 14:09:30 +0100
>
> > The autorelease pool sends dealloc to an object it has only if it's
> > retain count goes down to zero when it releases it.
> >
> > So, if you retain the object, you can autorelease (release in the future).
>
> Very interesting. I might have to go away and change the way I have
> implemented this in my own foundation kit in that case... I actually
> implemnted it using a flag to say whether or not an object had been
> autoreleased, to prevent it being autoreleased twice!
>
> -bat.
Yes, you can insert an object into an autorelease pool several times
like you can insert an object into an array at several indices. (And
of course, into several arrays and several autorelease pools). What's
important is the retain count and how and when it goes to 0.
--
__Pascal_Bourguignon__ http://www.informatimago.com/
----------------------------------------------------------------------