From 8cb0ae10245b4596ffcd818db984768c23ae6eb5 Mon Sep 17 00:00:00 2001 From: SUE Date: Sun, 17 Apr 2022 13:16:00 +0000 Subject: [PATCH] Signed-off-by:hellohyh001 --- interfaces/plugin/src/sensor_napi_utils.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/interfaces/plugin/src/sensor_napi_utils.cpp b/interfaces/plugin/src/sensor_napi_utils.cpp index d00ac1b9..a8a76144 100644 --- a/interfaces/plugin/src/sensor_napi_utils.cpp +++ b/interfaces/plugin/src/sensor_napi_utils.cpp @@ -524,6 +524,7 @@ void EmitUvEventLoop(sptr asyncCallbackInfo) "Asynccallback Type invalid in uv work"); g_convertfuncList[asyncCallbackInfo->type](env, asyncCallbackInfo, result); CHKNRV(env, napi_call_function(env, nullptr, callback, 1, &result[1], &callResult), "napi_call_function"); + asyncCallbackInfo->work = nullptr; CHKPV(work); delete work; work = nullptr; @@ -531,6 +532,7 @@ void EmitUvEventLoop(sptr asyncCallbackInfo) if (ret != 0) { SEN_HILOGE("uv_queue_work fail"); asyncCallbackInfo->callbackInfo = nullptr; + asyncCallbackInfo->work = nullptr; CHKPV(work); delete work; work = nullptr; -- Gitee