Re: NSApplication delegate not released on quit?
Re: NSApplication delegate not released on quit?
- Subject: Re: NSApplication delegate not released on quit?
- From: Ron Wagner <email@hidden>
- Date: Fri, 13 Jun 2003 18:05:39 -0400
Yes, it is the cleanup I'm worried about. I have some resources that
need to be released. So when I return NSTerminateNow from
applicationShouldTerminate I can be relatively assured that the
application will quit and not get canceled from any other mechanism?
Thanks,
Ron
On Friday, June 13, 2003, at 05:52 PM, Sherm Pendley wrote:
On Friday, June 13, 2003, at 05:15 PM, Ron Wagner wrote:
Should I be autoreleasing the delegate in the -
(NSApplicationTerminateReply)applicationShouldTerminate:
(NSApplication*) sender method if the application will be
terminating? Doesn't seem right since I haven't seen any sample code
do this.
There's no real point to releasing the delegate at all in this
situation. All it will do is release the memory used by that object
back to the application's memory heap - but that entire heap will be
released back to the OS when your app exits anyway. All you'd really
accomplish with an autorelease at that point would be a slight
increase in the amount of time it takes your app to shut down.
On the other paw, if your delegate needs to do some other cleanup
tasks, such as deleting temporary files, writing buffered information
to disk, and such, then -application(Should|Will)Terminate: is the
perfect place for it to do those tasks.
sherm--
Welcome to Rivendell, Mr. Anderson.
_______________________________________________
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.