From d1fce89017d81acc53923ecac94caefcb655b3b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Bl=C3=A4sing?= Date: Sun, 17 Mar 2024 21:43:26 +0100 Subject: [PATCH] X --- native/callback.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/native/callback.c b/native/callback.c index 464703ad7..73f6ae188 100644 --- a/native/callback.c +++ b/native/callback.c @@ -154,7 +154,7 @@ create_callback(JNIEnv* env, jobject obj, jobject method, for (i=0;i < argc;i++) { int jtype; jclass cls = (*env)->GetObjectArrayElement(env, arg_classes, i); - if (direct && ((cb->conversion_flags[i] = get_conversion_flag(env, cls)) != CVT_DEFAULT)) { + if (((cb->conversion_flags[i] = get_conversion_flag(env, cls)) != CVT_DEFAULT)) { cb->arg_classes[i] = (*env)->NewWeakGlobalRef(env, cls); cvt = 1; } @@ -219,8 +219,6 @@ create_callback(JNIEnv* env, jobject obj, jobject method, if (!direct || !cvt) { free(cb->conversion_flags); cb->conversion_flags = NULL; - free(cb->arg_classes); - cb->arg_classes = NULL; } if (direct) { cb->rflag = get_conversion_flag(env, return_class); @@ -426,7 +424,7 @@ invoke_callback(JNIEnv* env, callback *cb, ffi_cif* cif, void *resp, void **cbar *((void **)args[i+3]) = newJavaWString(env, *(void **)cbargs[i]); break; case CVT_STRUCTURE: - *((void **)args[i+3]) = newJavaStructure(env, *(void **)cbargs[i], cb->arg_classes[i]); + *((void **)args[i+3]) = newJavaStructure(env, *(void **)cbargs[i], cb-><[i]); break; case CVT_STRUCTURE_BYVAL: args[i+3] = alloca(sizeof(void *));