@@ -235,18 +235,25 @@ handle_open_doc(AppleEvent *theAppleEvent, AppleEvent *reply, long refCon)
235235}
236236
237237/* Install standard core event handlers */
238+ AEEventHandlerUPP open_doc_upp ;
239+ AEEventHandlerUPP open_app_upp ;
240+ AEEventHandlerUPP not_upp ;
238241
239242static void
240243set_ae_handlers ()
241244{
245+ open_doc_upp = NewAEEventHandlerProc (handle_open_doc );
246+ open_app_upp = NewAEEventHandlerProc (handle_open_app );
247+ not_upp = NewAEEventHandlerProc (handle_not );
248+
242249 AEInstallEventHandler (kCoreEventClass , kAEOpenApplication ,
243- NewAEEventHandlerProc ( handle_open_app ) , 0L , false);
250+ open_app_upp , 0L , false);
244251 AEInstallEventHandler (kCoreEventClass , kAEOpenDocuments ,
245- NewAEEventHandlerProc ( handle_open_doc ) , 0L , false);
252+ open_doc_upp , 0L , false);
246253 AEInstallEventHandler (kCoreEventClass , kAEPrintDocuments ,
247- NewAEEventHandlerProc ( handle_not ) , 0L , false);
254+ not_upp , 0L , false);
248255 AEInstallEventHandler (kCoreEventClass , kAEQuitApplication ,
249- NewAEEventHandlerProc ( handle_not ) , 0L , false);
256+ not_upp , 0L , false);
250257}
251258
252259/* Uninstall standard core event handlers */
@@ -255,13 +262,13 @@ static void
255262reset_ae_handlers ()
256263{
257264 AERemoveEventHandler (kCoreEventClass , kAEOpenApplication ,
258- NewAEEventHandlerProc ( handle_open_app ) , false);
265+ open_app_upp , false);
259266 AERemoveEventHandler (kCoreEventClass , kAEOpenDocuments ,
260- NewAEEventHandlerProc ( handle_open_doc ) , false);
267+ open_doc_upp , false);
261268 AERemoveEventHandler (kCoreEventClass , kAEPrintDocuments ,
262- NewAEEventHandlerProc ( handle_not ) , false);
269+ not_upp , false);
263270 AERemoveEventHandler (kCoreEventClass , kAEQuitApplication ,
264- NewAEEventHandlerProc ( handle_not ) , false);
271+ not_upp , false);
265272}
266273
267274/* Wait for events until a core event has been handled */
0 commit comments