|
14 | 14 | #include <Controls.h> |
15 | 15 |
|
16 | 16 | extern PyObject *ResObj_New(Handle); |
| 17 | +extern PyObject *ResObj_OptNew(Handle); |
17 | 18 | extern int ResObj_Convert(PyObject *, Handle *); |
18 | 19 |
|
19 | 20 | extern PyObject *WinObj_New(WindowPtr); |
@@ -1051,19 +1052,20 @@ static PyObject *AE_AEGetEventHandler(_self, _args) |
1051 | 1052 | OSErr _err; |
1052 | 1053 | AEEventClass theAEEventClass; |
1053 | 1054 | AEEventID theAEEventID; |
1054 | | - long procptr, handlerptr; |
1055 | | - |
| 1055 | + AEEventHandlerUPP handler__proc__ = upp_GenericEventHandler; |
| 1056 | + PyObject *handler; |
1056 | 1057 | if (!PyArg_ParseTuple(_args, "O&O&", |
1057 | 1058 | PyMac_GetOSType, &theAEEventClass, |
1058 | 1059 | PyMac_GetOSType, &theAEEventID)) |
1059 | 1060 | return NULL; |
1060 | 1061 | _err = AEGetEventHandler(theAEEventClass, |
1061 | 1062 | theAEEventID, |
1062 | | - (AEEventHandlerUPP *)&procptr, &handlerptr, |
| 1063 | + &handler__proc__, (long *)&handler, |
1063 | 1064 | 0); |
1064 | 1065 | 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 */ |
1067 | 1069 | return _res; |
1068 | 1070 | } |
1069 | 1071 |
|
|
0 commit comments