In article <oster-2E60FB.13521818042008@[EMAIL PROTECTED]
>,
David Phillip Oster <oster@[EMAIL PROTECTED]
> wrote:
> So what's going on here? Well, if you set a breakpoint on exit(), and
> just quit the program you'll see that the Quit menu command calls
>
> [NSApplication terminate: ... ];
>
> which in turn calls exit(). If you quit the program by logging out, the
> Finder sends your program a "quit" appleEvent, you'll still go through
> exit().
>
> I was surprised by this behavior, since MFC, Powerplant, and Carbon all
> normally cleanly terminate the runloop and return all the way out.
It's an optimisation to improve quitting speeds, so say the Cocoa folk.
When you quit an app, -dealloc is also not called for all the various
live objects.
applicationWillTerminate: is often useful for situations like these.
Sean


|