On Sep 16, 2013, at 9:12 , Uli Kusterer <witness.of.teacht...@gmx.net> wrote:

> On 16 Sep 2013, at 01:10, Greg Parker <gpar...@apple.com> 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 <marcel.wei...@gmail.com> 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 (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to