Re: [Pyobjc-dev] Reference Counting
Brought to you by:
ronaldoussoren
From: b.bum <bb...@ma...> - 2004-04-08 22:04:10
|
On Apr 8, 2004, at 1:59 PM, Michael Tsai wrote: > I've never heard that before. The docs say: > >> Released autorelease pools, if not on the top of the stack, cause all >> (unreleased) autorelease pools above them on the stack to be >> released, along with all their objects. If you neglect to send >> release to an autorelease pool when you are finished with it >> (something not recommended), it is released when one of the >> autorelease pools in which it nests is released. > > <http://developer.apple.com/Documentation/Cocoa/Conceptual/MemoryMgmt/ > Concepts/AutoreleasePools.html#//apple_ref/doc/uid/20000047/EGGBFFED> Yup. You're right. I'm wrong (though only technically -- the "something not recommended" would indicate that I was conceptually right ... ;-). Thanks for the pointer! This also explains the behavior in Ronald's code. It isn't a bug, it is a feature! Since the code was deallocating the old pool after creating a new pool, the new pool was "above" the old pool in the stack and was therefore removed along with the old pool. b.bum |