From cc456fbe82cf55fcec71d4237b86cea2bc1c1cef Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Sat, 29 Jul 1995 13:50:59 +0000 Subject: [PATCH] Un-installing of AE handlers fixed (AE is very picky that you specify the same UPP) --- Mac/Python/macgetargv.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/Mac/Python/macgetargv.c b/Mac/Python/macgetargv.c index 5f2e637718e..2c909973c53 100644 --- a/Mac/Python/macgetargv.c +++ b/Mac/Python/macgetargv.c @@ -235,18 +235,25 @@ handle_open_doc(AppleEvent *theAppleEvent, AppleEvent *reply, long refCon) } /* Install standard core event handlers */ +AEEventHandlerUPP open_doc_upp; +AEEventHandlerUPP open_app_upp; +AEEventHandlerUPP not_upp; static void set_ae_handlers() { + open_doc_upp = NewAEEventHandlerProc(handle_open_doc); + open_app_upp = NewAEEventHandlerProc(handle_open_app); + not_upp = NewAEEventHandlerProc(handle_not); + AEInstallEventHandler(kCoreEventClass, kAEOpenApplication, - NewAEEventHandlerProc(handle_open_app), 0L, false); + open_app_upp, 0L, false); AEInstallEventHandler(kCoreEventClass, kAEOpenDocuments, - NewAEEventHandlerProc(handle_open_doc), 0L, false); + open_doc_upp, 0L, false); AEInstallEventHandler(kCoreEventClass, kAEPrintDocuments, - NewAEEventHandlerProc(handle_not), 0L, false); + not_upp, 0L, false); AEInstallEventHandler(kCoreEventClass, kAEQuitApplication, - NewAEEventHandlerProc(handle_not), 0L, false); + not_upp, 0L, false); } /* Uninstall standard core event handlers */ @@ -255,13 +262,13 @@ static void reset_ae_handlers() { AERemoveEventHandler(kCoreEventClass, kAEOpenApplication, - NewAEEventHandlerProc(handle_open_app), false); + open_app_upp, false); AERemoveEventHandler(kCoreEventClass, kAEOpenDocuments, - NewAEEventHandlerProc(handle_open_doc), false); + open_doc_upp, false); AERemoveEventHandler(kCoreEventClass, kAEPrintDocuments, - NewAEEventHandlerProc(handle_not), false); + not_upp, false); AERemoveEventHandler(kCoreEventClass, kAEQuitApplication, - NewAEEventHandlerProc(handle_not), false); + not_upp, false); } /* Wait for events until a core event has been handled */