• 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: Document Unreleased Only When Quitting
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Document Unreleased Only When Quitting


  • Subject: Re: Document Unreleased Only When Quitting
  • From: Steven Kramer <email@hidden>
  • Date: Fri, 13 May 2005 16:18:10 +0200


Op 13-mei-05 om 12:23 heeft Seth Willits het volgende geschreven:

So why is it that only when quitting the application with an unsaved document that the document isn't actually released, and the application hangs in this termination cycle?



Any ideas are appreciated,



I think the big picture is that Cocoa is leaky in this respect, sort of. Meaning that it relies on the operating system to clean up on process termination. This is faster, because the OS doesn't have to go around destructing individual objects, it just reclaims memory, handles and other resources it knows about.

I'm not a fan of this approach, because (1) it makes it harder for me to debug allocations and (2) I think it breaks some logic.

(1) My usual resource leak policy is to assert that there are 0 allocations on the heap just before exit, which usually means all my objects were correctly destructed
(2) Some object's 'contract' might demand that they be dealloc'ed for whatever reason, you need to be very sure these objects are not referenced in some implicit way by the document and/or the window controller, bindings, etc.



Regards,

Steven Kramer

--
email@hidden
http://www.sprintteam.nl/

_______________________________________________
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


References: 
 >Document Unreleased Only When Quitting (From: Seth Willits <email@hidden>)

  • Prev by Date: Re: Display Keys-Values in Spotlight
  • Next by Date: Re: FSCopyObjectAsync: useless and crippled
  • Previous by thread: Document Unreleased Only When Quitting
  • Next by thread: Re: Document Unreleased Only When Quitting
  • Index(es):
    • Date
    • Thread