Lines 273-283
Link Here
|
273 |
PyErr_NoMemory(); |
273 |
PyErr_NoMemory(); |
274 |
return NULL; |
274 |
return NULL; |
275 |
} |
275 |
} |
|
|
276 |
#if FFI_CLOSURES |
276 |
p->pcl = MallocClosure(); |
277 |
p->pcl = MallocClosure(); |
277 |
if (p->pcl == NULL) { |
278 |
if (p->pcl == NULL) { |
278 |
PyErr_NoMemory(); |
279 |
PyErr_NoMemory(); |
279 |
goto error; |
280 |
goto error; |
280 |
} |
281 |
} |
|
|
282 |
#endif |
281 |
|
283 |
|
282 |
for (i = 0; i < nArgs; ++i) { |
284 |
for (i = 0; i < nArgs; ++i) { |
283 |
PyObject *cnv = PySequence_GetItem(converters, i); |
285 |
PyObject *cnv = PySequence_GetItem(converters, i); |
Lines 315-326
Link Here
|
315 |
"ffi_prep_cif failed with %d", result); |
317 |
"ffi_prep_cif failed with %d", result); |
316 |
goto error; |
318 |
goto error; |
317 |
} |
319 |
} |
|
|
320 |
#if FFI_CLOSURES |
318 |
result = ffi_prep_closure(p->pcl, &p->cif, closure_fcn, p); |
321 |
result = ffi_prep_closure(p->pcl, &p->cif, closure_fcn, p); |
319 |
if (result != FFI_OK) { |
322 |
if (result != FFI_OK) { |
320 |
PyErr_Format(PyExc_RuntimeError, |
323 |
PyErr_Format(PyExc_RuntimeError, |
321 |
"ffi_prep_closure failed with %d", result); |
324 |
"ffi_prep_closure failed with %d", result); |
322 |
goto error; |
325 |
goto error; |
323 |
} |
326 |
} |
|
|
327 |
#endif |
324 |
|
328 |
|
325 |
p->converters = converters; |
329 |
p->converters = converters; |
326 |
p->callable = callable; |
330 |
p->callable = callable; |
Lines 328-335
Link Here
|
328 |
|
332 |
|
329 |
error: |
333 |
error: |
330 |
if (p) { |
334 |
if (p) { |
|
|
335 |
#if FFI_CLOSURES |
331 |
if (p->pcl) |
336 |
if (p->pcl) |
332 |
FreeClosure(p->pcl); |
337 |
FreeClosure(p->pcl); |
|
|
338 |
#endif |
333 |
PyMem_Free(p); |
339 |
PyMem_Free(p); |
334 |
} |
340 |
} |
335 |
return NULL; |
341 |
return NULL; |