Skip to content

Commit

Permalink
Fix the JNI local ref overflow issue.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 351906708
  • Loading branch information
xunkai55 committed Jan 15, 2021
1 parent a63d02d commit 6ccadfc
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ jobject ConvertToCategory(JNIEnv* env, const Class& classification) {
jobject jcategory =
env->CallStaticObjectMethod(category_class, category_create, label,
display_name, classification.score());
env->DeleteLocalRef(category_class);
env->DeleteLocalRef(label);
env->DeleteLocalRef(display_name);
return jcategory;
}

Expand Down

0 comments on commit 6ccadfc

Please sign in to comment.