Commit 2f43897f authored by Matthieu Bouron's avatar Matthieu Bouron

lavc/ffjni: fix local reference leak

Reviewed-by: 's avatarClément Bœsch <u@pkh.me>
parent 5d0b8b1a
...@@ -303,6 +303,11 @@ int ff_jni_init_jfields(JNIEnv *env, void *jfields, const struct FFJniField *jfi ...@@ -303,6 +303,11 @@ int ff_jni_init_jfields(JNIEnv *env, void *jfields, const struct FFJniField *jfi
last_clazz = *(jclass*)((uint8_t*)jfields + jfields_mapping[i].offset) = last_clazz = *(jclass*)((uint8_t*)jfields + jfields_mapping[i].offset) =
global ? (*env)->NewGlobalRef(env, clazz) : clazz; global ? (*env)->NewGlobalRef(env, clazz) : clazz;
if (global) {
(*env)->DeleteLocalRef(env, clazz);
}
} else { } else {
if (!last_clazz) { if (!last_clazz) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment