Re: How to release all objects on 'Quit' of application
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.