Skip to content

Commit

Permalink
unix/modjni: call_method: Delete done local references in loop.
Browse files Browse the repository at this point in the history
To avoid local ref table overflow.
  • Loading branch information
Paul Sokolovsky committed Sep 28, 2015
1 parent f1a9923 commit 7702028
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions unix/modjni.c
Original file line number Diff line number Diff line change
Expand Up @@ -378,12 +378,16 @@ STATIC mp_obj_t call_method(jobject obj, const char *name, jarray methods, bool
}

JJ(ReleaseStringUTFChars, name_o, decl);
JJ(DeleteLocalRef, name_o);
JJ(DeleteLocalRef, meth);
return ret;
}
}

next_method:
JJ(ReleaseStringUTFChars, name_o, decl);
JJ(DeleteLocalRef, name_o);
JJ(DeleteLocalRef, meth);
}

nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_TypeError, "method not found"));
Expand Down

0 comments on commit 7702028

Please sign in to comment.