Lines 20-27
Link Here
|
20 |
Py_XDECREF(self->converters); |
20 |
Py_XDECREF(self->converters); |
21 |
Py_XDECREF(self->callable); |
21 |
Py_XDECREF(self->callable); |
22 |
Py_XDECREF(self->restype); |
22 |
Py_XDECREF(self->restype); |
|
|
23 |
#if FFI_CLOSURES |
23 |
if (self->pcl) |
24 |
if (self->pcl) |
24 |
FreeClosure(self->pcl); |
25 |
FreeClosure(self->pcl); |
|
|
26 |
#endif |
25 |
PyObject_Del(self); |
27 |
PyObject_Del(self); |
26 |
} |
28 |
} |
27 |
|
29 |
|
Lines 365-376
Link Here
|
365 |
|
367 |
|
366 |
assert(CThunk_CheckExact(p)); |
368 |
assert(CThunk_CheckExact(p)); |
367 |
|
369 |
|
|
|
370 |
#if FFI_CLOSURES |
368 |
p->pcl = MallocClosure(); |
371 |
p->pcl = MallocClosure(); |
369 |
if (p->pcl == NULL) { |
372 |
if (p->pcl == NULL) { |
370 |
PyErr_NoMemory(); |
373 |
PyErr_NoMemory(); |
371 |
goto error; |
374 |
goto error; |
372 |
} |
375 |
} |
373 |
|
376 |
#endif |
374 |
for (i = 0; i < nArgs; ++i) { |
377 |
for (i = 0; i < nArgs; ++i) { |
375 |
PyObject *cnv = PySequence_GetItem(converters, i); |
378 |
PyObject *cnv = PySequence_GetItem(converters, i); |
376 |
if (cnv == NULL) |
379 |
if (cnv == NULL) |
Lines 409-421
Link Here
|
409 |
"ffi_prep_cif failed with %d", result); |
412 |
"ffi_prep_cif failed with %d", result); |
410 |
goto error; |
413 |
goto error; |
411 |
} |
414 |
} |
|
|
415 |
#if FFI_CLOSURES |
412 |
result = ffi_prep_closure(p->pcl, &p->cif, closure_fcn, p); |
416 |
result = ffi_prep_closure(p->pcl, &p->cif, closure_fcn, p); |
413 |
if (result != FFI_OK) { |
417 |
if (result != FFI_OK) { |
414 |
PyErr_Format(PyExc_RuntimeError, |
418 |
PyErr_Format(PyExc_RuntimeError, |
415 |
"ffi_prep_closure failed with %d", result); |
419 |
"ffi_prep_closure failed with %d", result); |
416 |
goto error; |
420 |
goto error; |
417 |
} |
421 |
} |
418 |
|
422 |
#endif |
419 |
Py_INCREF(converters); |
423 |
Py_INCREF(converters); |
420 |
p->converters = converters; |
424 |
p->converters = converters; |
421 |
Py_INCREF(callable); |
425 |
Py_INCREF(callable); |