Re: Newbie question: autorelease sends autorelease
Re: Newbie question: autorelease sends autorelease
- Subject: Re: Newbie question: autorelease sends autorelease
- From: j o a r <email@hidden>
- Date: Wed, 22 Sep 2004 09:26:57 +0200
On 2004-09-22, at 08.50, Chris Ridd wrote:
OK, so what's the answer to the original question then? :-)
Yes, exactly - if I'm so freaking smart, what's the bloody answer? ;)
A quick test tells me that the answer is (a). I could be wrong, but I
think it's (a).
Example:
Object a retains object b.
Object a gets autoreleased.
When the NSAutoreleasePool gets dealloc'd, a gets released.
The dealloc handler for a sends an autoreleas to b.
What happens to b?
This is my guess:
"a" is deallocated in response to a release message sent from
autorelease pool "p". "a" send autorelease to object "b" in it's
dealloc method, causing "b" to be added to "p". When "p" continues
through it's list of objects to release it will eventually reach "b"
and send it a release message in the same "scope" as "a".
j o a r
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden