Skip to content

Commit

Permalink
Fix free_callback JNI weak reference leak
Browse files Browse the repository at this point in the history
  • Loading branch information
xiezhaokun committed Jan 9, 2024
1 parent 1dd63c8 commit 4bf9f92
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion native/callback.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 ((cb->conversion_flags[i] = get_conversion_flag(env, cls)) != CVT_DEFAULT) {
if (direct && ((cb->conversion_flags[i] = get_conversion_flag(env, cls)) != CVT_DEFAULT)) {
cb->arg_classes[i] = (*env)->NewWeakGlobalRef(env, cls);
cvt = 1;
}
Expand Down

0 comments on commit 4bf9f92

Please sign in to comment.