Re: NSApplication delegate not released on quit?
Re: NSApplication delegate not released on quit?
- Subject: Re: NSApplication delegate not released on quit?
- From: Sherm Pendley <email@hidden>
- Date: Fri, 13 Jun 2003 17:52:37 -0400
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.