From 07ae1dab0730f2c880d9640e4ec16944b78960f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E6=B5=A9=E5=93=B2?= <1780243524@qq.com> Date: Thu, 13 Jun 2024 14:12:19 +0800 Subject: [PATCH] fix(android): resolve local ref overflow --- android/sdk/src/main/jni/src/jni/convert_utils.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/android/sdk/src/main/jni/src/jni/convert_utils.cc b/android/sdk/src/main/jni/src/jni/convert_utils.cc index a596b371bdd..79a070442b0 100644 --- a/android/sdk/src/main/jni/src/jni/convert_utils.cc +++ b/android/sdk/src/main/jni/src/jni/convert_utils.cc @@ -338,6 +338,7 @@ std::tuple ConvertUtils::ToHippyMap(const std::share std::shared_ptr item = v8_ctx->CopyArrayElement(array, i + 1); auto to_jobject_tuple = ToJObject(ctx, item); if (!std::get<0>(to_jobject_tuple)) { + j_env->DeleteLocalRef(key_j_obj); return std::make_tuple(false, std::get<1>(to_jobject_tuple), static_cast(nullptr)); } jobject value_j_obj = std::get<2>(to_jobject_tuple); @@ -638,6 +639,7 @@ std::tupleCreateNull(); } else { + j_env->DeleteLocalRef(obj); return std::make_tuple(false, "UnSupported Type in HippyArray or HippyMap", static_cast>(nullptr)); }