From 8228de319d00df9d9362d5115014107652cee206 Mon Sep 17 00:00:00 2001 From: houdisheng Date: Thu, 23 Mar 2023 21:31:23 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3uv=5Fqu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: houdisheng --- frameworks/src/app_group_observer_napi.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/frameworks/src/app_group_observer_napi.cpp b/frameworks/src/app_group_observer_napi.cpp index f9ab0c1..142a945 100644 --- a/frameworks/src/app_group_observer_napi.cpp +++ b/frameworks/src/app_group_observer_napi.cpp @@ -90,6 +90,11 @@ void UvQueueWorkOnAppGroupChanged(uv_work_t *work, int status) work = nullptr; return; } + napi_handle_scope scope = nullptr; + napi_open_handle_scope(callbackReceiveDataWorkerData->env, &scope); + if (scope == nullptr) { + return; + } napi_value result = nullptr; napi_create_object(callbackReceiveDataWorkerData->env, &result); @@ -113,6 +118,8 @@ void UvQueueWorkOnAppGroupChanged(uv_work_t *work, int status) results[PARAM_SECOND] = result; NAPI_CALL_RETURN_VOID(callbackReceiveDataWorkerData->env, napi_call_function(callbackReceiveDataWorkerData->env, undefined, callback, ARGS_TWO, &results[PARAM_FIRST], &resultout)); + + napi_close_handle_scope(callbackReceiveDataWorkerData->env, scope); delete callbackReceiveDataWorkerData; callbackReceiveDataWorkerData = nullptr; delete work; -- Gitee