av_log(log_ctx, AV_LOG_ERROR, "The specified JNI version is not supported\n");
break;
default:
- av_log(log_ctx, AV_LOG_ERROR, "Failed to get the JNI environment attached to this thread");
+ av_log(log_ctx, AV_LOG_ERROR, "Failed to get the JNI environment attached to this thread\n");
break;
}
last_clazz = *(jclass*)((uint8_t*)jfields + jfields_mapping[i].offset) =
global ? (*env)->NewGlobalRef(env, clazz) : clazz;
+
+ if (global) {
+ (*env)->DeleteLocalRef(env, clazz);
+ }
+
} else {
if (!last_clazz) {