Re: [[object autorelease] release]
Re: [[object autorelease] release]
- Subject: Re: [[object autorelease] release]
- From: Markus Hitter <email@hidden>
- Date: Tue, 2 Oct 2001 22:05:45 +0200
Am Dienstag, 2. Oktober 2001 um 19:36 schrieb Ondra Cada:
Do we use both the same definition of "contradiction"?
Of course we do ;-)
"app crashes when you release an autorelease[d] object"
I said that it's not true (which it really is not).
You meant "does not crash immediately", Rosyna and me meant
"might crash at all". Both is right. Anyway, if I offended you:
I'm sorry about that offense.
MH> Given this additional feature, you could avoid all hassles with
MH> nested autorelease pools. They would be just obsolete.
Why, on earth?!?
Instead of allocation an inner autorelease pool, you would
simply send all these objects you want to get rid of a release
message. Even better, you had no problem to allocate some object
in the inner loop which you want to hold beyond this inner loop.
MH> The downside is probably, there is no way to remove a single
MH> given object efficiently from an autorelease pool. At least not
MH> as efficiently as when it is released by the pool's mechanism.
Nope. There is no efficient way how to find all pools which
contain a given
object. At least not as efficient as it could be afforded to be used on
_each_ release.
Even when considering you had only one pool in question then,
you're probably still right.
Not speaking of the fact that there are almost no situations
when it would
be really useable.
Well, IIRC it would fit to all code snippets on this list which
were used to illustrate the use of an inner autorelease pool.
Anyway, since there seems no efficient way to implement the
thing we will continue to either avoid autoreleased objects of
to allocate some inner pool.
Cheers,
Markus
- - - - - - - - - - - - - - - - - - -
Dipl. Ing. Markus Hitter
http://www.jump-ing.de/