Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8ce4d51

Browse files
committed
Different arg to GetEventHandler (but I cannot really remember fixing
this.... Hope it is correct)
1 parent 7e0da90 commit 8ce4d51

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

Mac/Modules/ae/AEmodule.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include <Controls.h>
1515

1616
extern PyObject *ResObj_New(Handle);
17+
extern PyObject *ResObj_OptNew(Handle);
1718
extern int ResObj_Convert(PyObject *, Handle *);
1819

1920
extern PyObject *WinObj_New(WindowPtr);
@@ -1051,19 +1052,20 @@ static PyObject *AE_AEGetEventHandler(_self, _args)
10511052
OSErr _err;
10521053
AEEventClass theAEEventClass;
10531054
AEEventID theAEEventID;
1054-
long procptr, handlerptr;
1055-
1055+
AEEventHandlerUPP handler__proc__ = upp_GenericEventHandler;
1056+
PyObject *handler;
10561057
if (!PyArg_ParseTuple(_args, "O&O&",
10571058
PyMac_GetOSType, &theAEEventClass,
10581059
PyMac_GetOSType, &theAEEventID))
10591060
return NULL;
10601061
_err = AEGetEventHandler(theAEEventClass,
10611062
theAEEventID,
1062-
(AEEventHandlerUPP *)&procptr, &handlerptr,
1063+
&handler__proc__, (long *)&handler,
10631064
0);
10641065
if (_err != noErr) return PyMac_Error(_err);
1065-
_res = Py_BuildValue("ll",
1066-
(long)procptr, (long)handlerptr);
1066+
_res = Py_BuildValue("O",
1067+
handler);
1068+
Py_INCREF(handler); /* XXX leak, but needed */
10671069
return _res;
10681070
}
10691071

0 commit comments

Comments
 (0)