From c491eda27b78522aade9610ed0767b0365e4eee8 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:38:01 +0800 Subject: [PATCH] fix(android): resolve local ref overflow --- .../connector/driver/js/src/main/cpp/src/convert_utils.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/framework/android/connector/driver/js/src/main/cpp/src/convert_utils.cc b/framework/android/connector/driver/js/src/main/cpp/src/convert_utils.cc index 84f1af7a167..46615e04cf6 100644 --- a/framework/android/connector/driver/js/src/main/cpp/src/convert_utils.cc +++ b/framework/android/connector/driver/js/src/main/cpp/src/convert_utils.cc @@ -344,6 +344,7 @@ std::tuple ConvertUtils::ToHippyMap(const std::share 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); @@ -644,6 +645,7 @@ std::tupleCreateNull(); } else { + j_env->DeleteLocalRef(obj); return std::make_tuple(false, "UnSupported Type in HippyArray or HippyMap", static_cast>(nullptr)); }