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 protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to