Sync PR: cocos2d-x #18299: JNI ERROR (app bug): local reference table overflow (max=512) (#1024)

* Sync PR:  cocos2d-x #18299: JNI ERROR (app bug): local reference table overflow (max=512)

* Fixes potential memory leak if can't find class by jsb.reflection.callStaticMethod.
This commit is contained in:
James Chen
2017-12-08 18:25:04 +08:00
committed by GitHub
parent 4708131018
commit 44813f4166
2 changed files with 2 additions and 0 deletions
@@ -387,6 +387,7 @@ bool JavaScriptJavaBridge::CallInfo::getMethodInfo()
if (NULL == m_classID) {
SE_LOGD("Classloader failed to find class of %s", m_className.c_str());
m_env->DeleteLocalRef(_jstrClassName);
m_env->ExceptionClear();
m_error = JSJ_ERR_CLASS_NOT_FOUND;
return false;