Skip to content

Commit

Permalink
fix(android): resolve local ref overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
1780243524 authored and hippy-actions[bot] committed Jun 13, 2024
1 parent 4180517 commit 76d1207
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions android/sdk/src/main/jni/src/jni/convert_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,7 @@ std::tuple<bool, std::string, jobject> ConvertUtils::ToHippyMap(const std::share
std::shared_ptr<CtxValue> 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<jobject>(nullptr));
}
jobject value_j_obj = std::get<2>(to_jobject_tuple);
Expand Down Expand Up @@ -638,6 +639,7 @@ std::tuple<bool,
} else if (!obj) {
result = ctx->CreateNull();
} else {
j_env->DeleteLocalRef(obj);
return std::make_tuple(false, "UnSupported Type in HippyArray or HippyMap",
static_cast<std::shared_ptr<CtxValue>>(nullptr));
}
Expand Down

0 comments on commit 76d1207

Please sign in to comment.