update interfaces/kits/napi/src/bg_continuous_task_napi_module.cpp.

Signed-off-by: 胡伟 <huwei169@huawei.com>
This commit is contained in:
胡伟 2024-10-31 06:42:23 +00:00 committed by Gitee
parent 785a08ae27
commit c956e52151
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -559,6 +559,7 @@ napi_value UpdateBackgroundRunning(napi_env env, napi_callback_info info, bool i
}
napi_value ret {nullptr};
callbackPtr.release();
ret = UpdateBackgroundRunningPromise(env, asyncCallbackInfo, isThrow);
if (ret == nullptr) {
BGTASK_LOGE("ret is nullpter");
@ -568,7 +569,6 @@ napi_value UpdateBackgroundRunning(napi_env env, napi_callback_info info, bool i
}
ret = WrapVoidToJS(env);
}
callbackPtr.release();
return ret;
}
@ -603,7 +603,7 @@ napi_value StartBackgroundRunning(napi_env env, napi_callback_info info, bool is
} else {
ret = StartBackgroundRunningPromise(env, asyncCallbackInfo, isThrow);
}
callbackPtr.release();
if (ret == nullptr) {
BGTASK_LOGE("ret is nullpter");
if (asyncCallbackInfo != nullptr) {
@ -612,7 +612,6 @@ napi_value StartBackgroundRunning(napi_env env, napi_callback_info info, bool is
}
ret = WrapVoidToJS(env);
}
callbackPtr.release();
return ret;
}
@ -755,7 +754,7 @@ napi_value StopBackgroundRunning(napi_env env, napi_callback_info info, bool isT
} else {
ret = StopBackgroundRunningPromise(env, asyncCallbackInfo, isThrow);
}
callbackPtr.release();
if (ret == nullptr) {
BGTASK_LOGE("ret is nullpter");
if (asyncCallbackInfo != nullptr) {
@ -764,7 +763,6 @@ napi_value StopBackgroundRunning(napi_env env, napi_callback_info info, bool isT
}
ret = WrapVoidToJS(env);
}
callbackPtr.release();
return ret;
}