--- old/src/macosx/native/sun/awt/awt.m 2012-12-04 16:21:12.000000000 +0400 +++ new/src/macosx/native/sun/awt/awt.m 2012-12-04 16:21:12.000000000 +0400 @@ -95,7 +95,7 @@ CFRelease(busyObserver); CFRelease(notBusyObserver); - + if (!headless) setBusy(YES); // Set the java name of the AppKit main thread appropriately. @@ -367,7 +367,8 @@ CFRunLoopRef runLoop = [[NSRunLoop currentRunLoop] getCFRunLoop]; CFRunLoopRemoveObserver(runLoop, busyObserver, kCFRunLoopDefaultMode); CFRunLoopRemoveObserver(runLoop, notBusyObserver, kCFRunLoopDefaultMode); - + // We don't track if the runloop is busy, so set it free to let AWT finish when it needs + setBusy(NO); busyObserver = NULL; notBusyObserver = NULL; } else {