Re: Unexpected behavior with autorelease pool
Re: Unexpected behavior with autorelease pool
- Subject: Re: Unexpected behavior with autorelease pool
- From: Nick Zitzmann <email@hidden>
- Date: Sun, 14 Dec 2008 14:13:03 -0700
On Dec 14, 2008, at 10:55 AM, Krishna Kotecha wrote:
As the comment say, I would expect an error to occur due the fact
Counter:dealloc: is releasing an autorelease object. However the
application
exits cleanly.
Shouldn't this code be causing an error at some point? And if not,
why not?
No, it should not. It is perfectly legal for autorelease pools to
release memory created by other objects. It would, however, cause a
crash if the pool was popped before the object with the number was
released, and you tried to access the number pointer. It would only
cause a runtime error instead of a crash if you had zombies turned on.
Nick Zitzmann
<http://www.chronosnet.com/>
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden