Skip to content

Commit 6ccadfc

Browse files
committed
Fix the JNI local ref overflow issue.
PiperOrigin-RevId: 351906708
1 parent a63d02d commit 6ccadfc

File tree

1 file changed

+3
-0
lines changed
  • tensorflow_lite_support/java/src/native/task/vision

1 file changed

+3
-0
lines changed

tensorflow_lite_support/java/src/native/task/vision/jni_utils.cc

+3
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ jobject ConvertToCategory(JNIEnv* env, const Class& classification) {
5050
jobject jcategory =
5151
env->CallStaticObjectMethod(category_class, category_create, label,
5252
display_name, classification.score());
53+
env->DeleteLocalRef(category_class);
54+
env->DeleteLocalRef(label);
55+
env->DeleteLocalRef(display_name);
5356
return jcategory;
5457
}
5558

0 commit comments

Comments
 (0)