• 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: How to release all objects on 'Quit' of application
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to release all objects on 'Quit' of application


  • Subject: Re: How to release all objects on 'Quit' of application
  • From: "M. Uli Kusterer" <email@hidden>
  • Date: Fri, 2 Apr 2004 14:27:35 +0200

At 12:10 Uhr +0100 02.04.2004, Nicko van Someren wrote:
The application's delegate can implement applicationShouldTerminate:, which will be called when the user tries to quit or when the application is asked to quit for, for instance, a system restart. You can release things here even if you always return NSTerminateNow to let the application go ahead and quit.

I don't think applicationShouldTerminate: is the right choice. I'd suggest you rather use applicationWillTerminate: or whatever the notification function called on the delegate was called again. That is only sent when the application is actually about to quit.

As long as you are aware that on MacOS X all memory your application allocates is automatically disposed of when you quit, so unless you're saving an application-wide cache or the user's settings, deleting a temporary file, or unregistering a device or something like that, you don't really need to dispose anything when your application quits.
--
Cheers,
M. Uli Kusterer
------------------------------------------------------------
"The Witnesses of TeachText are everywhere..."
http://www.zathras.de
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


References: 
 >Re: How to release all objects on 'Quit' of application (From: Nicko van Someren <email@hidden>)

  • Prev by Date: Re: Bug in Cocoa drawing? (was 'Changing subviews during drawing')
  • Next by Date: Re: Embedding a Check Box in an NSTableView
  • Previous by thread: Re: How to release all objects on 'Quit' of application
  • Next by thread: Re: How to release all objects on 'Quit' of application
  • Index(es):
    • Date
    • Thread