Re: RunLoop in Helper Tool
Re: RunLoop in Helper Tool
- Subject: Re: RunLoop in Helper Tool
- From: Marcel Weiher <email@hidden>
- Date: Sun, 15 Sep 2013 19:50:11 +0200
On Sep 15, 2013, at 17:04 , Kevin Meaney <email@hidden> wrote:
> On 15 Sep 2013, at 15:30, Marcel Weiher <email@hidden> wrote:
>> Do all the cleanup you want to do and then exit(0) ?
>
> I was doing exit(0) but after reading this discussion I thought it would be cleaner to do the CFRunLoopStop on the main thread.
I also used to think it was a good idea to clean up after yourself. However, a lot of in-process cleanup is at best just simply wasted, the OS will recover all those resources much more effectively and safely. What’s worse, the cleanup code can cause significant issues, I remember the image processing program that swapped back a lot of its image-cache in the process of freeing it, because the malloc metadata was kept on the same VM page as the data itself.
> Unfortunately I'd broken my LaunchAgent doing some other stuff at the time and just now I've got stuff working and then I've been wondering why LaunchAgent doesn't stop. Back to exit(0) it is.
If you get queasy about exiting so abruptly, remind yourself that sudden termination is a kill -9 … :-)
Marcel
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden