sqInt ioExit(void)


Parms: NONE
return: NONE, fake return of zero
From: Interpreter
Why:
image read failure, or primitiveQuit or some other quit action via platform code.

Responsibility:
Terminate running application on quit.
may ioShutdownModules to shutdown plugins
calls exit(0) on unix machines
control might not return to caller, see man exit(0)
The debate is does the application actually need to do anything other than exit? However historically this API was written when applications had to share resources and at quit time had to do cleanup chores.

MacIntosh
Called by ioProcessEvents if gQuitNowRightNow which can be triggered by a macintosh menu, or system shutdown if the info.plist setting for SqueakQuitOnQuitAppleEvent=YES, or at startup time if the user choosed to cancel the select an image to use dialog, or if running as a headless application for the browser we determine the browser parent process has quit.
os-9/OSXCarbon
Restore menu bar if non-headless or running browser in full screen.
Unload clipboard scrap (no-op on OSX)
free image memory allocation
calls ExitToShell versus exit(0)

Cocoa:
See iPhone

iPhone
calls ioShutdownAllModules, and MenuBarRestore (no-op), then exit(0)
To determine is if applicationWillTerminate: should work with gQuitNowRightNow
It is illegal to call exit() on an iPhone according the Apple's guidelines for the App Approval process.

Unix
calls dpy->winExit, does NOT CALL ioShutdownModules

Windows
{much more work to cleanup environment) calls printCallStack if this is not a clean quit, clean up if a browser plugin, deal with sytemtray, close stderr/stdout, release virtual memory, deal OLE cleanup.

BUGS
Sometimes plugin cleanup work causes the VM to crash because of poorly written plugin termination code.
Unix code does not call ioShutdownAllModules, this may or may not be an issue.
There are no comments on this page.
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki