• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Unexpected behavior with autorelease pool
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Unexpected behaviour with autorelease pool (From: "Krishna Kotecha" <email@hidden>)

  • Prev by Date: Problem with Bindings, Core Data, Data Model, NSPathControl
  • Next by Date: Re: Unexpected behaviour with autorelease pool
  • Previous by thread: Unexpected behaviour with autorelease pool
  • Next by thread: Re: Unexpected behaviour with autorelease pool
  • Index(es):
    • Date
    • Thread