[android] jni clean up - missing a couple DeleteLocalRef

This commit is contained in:
osana
2018-02-19 22:55:43 -05:00
committed by Tobrun
parent b16893f903
commit 1862760faf
4 changed files with 11 additions and 3 deletions

View File

@@ -28,6 +28,7 @@ inline jni::jobject* toArrayList(JNIEnv& env, jni::jarray<T>& array) {
inline std::vector<std::string> toVector(JNIEnv& env, jni::jarray<jni::jobject>& array) {
std::vector<std::string> vector;
std::size_t len = jni::GetArrayLength(env, array);
vector.reserve(len);
for (std::size_t i = 0; i < len; i++) {
jni::jstring* jstr = reinterpret_cast<jni::jstring*>(jni::GetObjectArrayElement(env, array, i));