XQuartz: Avoid a possible spinlock in applicationWillTerminate

This commit is contained in:
Jeremy Huddleston 2009-07-28 22:52:33 -07:00
parent 227c6e01a6
commit f430cda0fd

View File

@ -781,13 +781,16 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn row:(int)row
- (void) applicationWillTerminate:(NSNotification *)aNotification
{
unsigned remain;
[X11App prefs_synchronize];
/* shutdown the X server, it will exit () for us. */
DarwinSendDDXEvent(kXquartzQuit, 0);
/* In case it doesn't, exit anyway after a while. */
while (sleep (10) != 0) ;
remain = 10000000;
while((remain = usleep(remain)) > 0);
exit (1);
}