fix MrEd mac event-loop problems

svn: r13842
This commit is contained in:
Matthew Flatt 2009-02-25 21:12:18 +00:00
parent 42adbca527
commit 79b906e713

View File

@ -285,9 +285,6 @@ static int waiting_for_next_event;
static int wne_handlersInstalled;
static int pending_self_ae;
static int ae_target_ready = 0;
static AEAddressDesc ae_target;
static void EnsureWNEReturn()
{
/* Generate an event that WaitNextEvent() will return, but that we can
@ -301,18 +298,17 @@ static void EnsureWNEReturn()
dummy AppleEvent and defeat the purpose. */
if (!pending_self_ae) {
ProcessSerialNumber psn;
AppleEvent ae;
AppleEvent ae, ae_target;
pending_self_ae = 1;
GetCurrentProcess(&psn);
if (!ae_target_ready) {
AECreateDesc(typeProcessSerialNumber, &psn, sizeof(psn), &ae_target);
ae_target_ready = 1;
}
AECreateDesc(typeProcessSerialNumber, &psn, sizeof(psn), &ae_target);
AECreateAppleEvent('MrEd', 'Smug', &ae_target, kAutoGenerateReturnID, kAnyTransactionID, &ae);
AESend(&ae, NULL, kAENoReply, kAENormalPriority, kNoTimeOut, NULL, NULL);
AEDisposeDesc(&ae);
/* Not supposed to dispose? */
/* AEDisposeDesc(&ae); */
/* AEDisposeDesc(&ae_target); */
}
}