call->code);
#elif PSI_HAVE_FFI_PREP_CLOSURE
- rc = ffi_prep_closure(data->code, &context->signature, psi_ffi_handler, data);
+ rc = ffi_prep_closure(call->code, &context->signature, psi_ffi_handler, impl);
#else
# error "Neither ffi_prep_closure() nor ffi_prep_closure_loc() available"
#endif
C->context = PSI_LibffiContextInit(NULL);
}
-static void psi_ffi_dtor(PSI_Context *C) {
- size_t i;
+static void psi_ffi_dtor(PSI_Context *C)
+{
+ if (C->decls) {
+ size_t i;
- for (i = 0; i < C->decls->count; ++i) {
- decl *decl = C->decls->list[i];
+ for (i = 0; i < C->decls->count; ++i) {
+ decl *decl = C->decls->list[i];
- if (decl->call.info) {
- PSI_LibffiCallFree(decl->call.info);
+ if (decl->call.info) {
+ PSI_LibffiCallFree(decl->call.info);
+ }
}
}
free(C->context);