[android] Fixed local reference table overflow during getting localized names for feature types

This commit is contained in:
Александр Зацепин 2019-10-11 18:36:41 +03:00 committed by Daria Volvenkova
parent d665a38d9c
commit bcf6966318

View file

@ -22,11 +22,10 @@ std::string GetLocalizedStringByUtil(jmethodID const & methodId, std::string con
JNIEnv * env = jni::GetEnv();
jni::TScopedLocalRef strRef(env, jni::ToJavaString(env, str));
auto localizedString = env->CallStaticObjectMethod(g_utilsClazz, methodId,
android::Platform::Instance().GetContext(),
strRef.get());
return jni::ToNativeString(env, static_cast<jstring>(localizedString));
jobject context = android::Platform::Instance().GetContext();
jni::TScopedLocalRef localizedStrRef(env, env->CallStaticObjectMethod(g_utilsClazz, methodId,
context, strRef.get()));
return jni::ToNativeString(env, static_cast<jstring>(localizedStrRef.get()));
}
} // namespace