Re: RunLoop in Helper Tool
Re: RunLoop in Helper Tool
- Subject: Re: RunLoop in Helper Tool
- From: Marcel Weiher <email@hidden>
- Date: Mon, 16 Sep 2013 12:53:49 +0200
On Sep 16, 2013, at 9:12 , Uli Kusterer <email@hidden> wrote:
> On 16 Sep 2013, at 01:10, Greg Parker <email@hidden> wrote:
>> And of course every Cocoa app halts by calling exit(). NSApplicationMain() never returns. (I'm pretty sure it doesn't attempt to stop the main run loop, either.)
>
> It does go and close all documents and send NSApplicationWillTerminateNotification and ask the app delegate if it’s OK to quit though. So it’s a tad more graceful than just exit() alone.
Hmm…I don’t think Greg or anyone else said anything about calling exit() alone. For example:
On Sep 15, 2013, at 16:30 , Marcel Weiher <email@hidden> wrote:
> Do all the cleanup you want to do and then exit(0) ?
> But yeah, NSApplicationMain doesn’t return, and that silly autorelease pool most people put in main() these days never gets released, just accumulating any objects that get autoreleased on the main thread without any other pool in place.
Yes, hopefully it doesn’t get released. The reason to put it there was to avoid console messages of the form “object xyz autoreleased without a pool in place - just leaking”. Better to have them leak silently in a pool than with a console message, if they are indeed top-level objects that are supposed to stick around.
Just testing it now on my Mac doesn’t show the message. Has it been removed/optionalized or are we now getting an automatic top-level pool?
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