diff --git a/frameworks/js/napi/include/async_callback_info.h b/frameworks/js/napi/include/async_callback_info.h index f60bbb9ea5cac582e72009e4e1fd1f525a4425d7..017ea65a86cb965f2c9ec6208d0a7ac815bb79a2 100644 --- a/frameworks/js/napi/include/async_callback_info.h +++ b/frameworks/js/napi/include/async_callback_info.h @@ -118,11 +118,13 @@ public: if (asyncWork != nullptr) { SEN_HILOGD("Delete async work"); napi_delete_async_work(env, asyncWork); + asyncWork = nullptr; } for (int32_t i = 0; i < CALLBACK_NUM; ++i) { if (callback[i] != nullptr) { SEN_HILOGD("Delete reference, i:%{public}d", i); napi_delete_reference(env, callback[i]); + callback[i] = nullptr; } } } diff --git a/services/src/sensor_power_policy.cpp b/services/src/sensor_power_policy.cpp index 82bbf15799caf9b206bcccf847b93a9f2e24fb47..2debb6c20fc330128bfae07a43ff499f7fad8959 100644 --- a/services/src/sensor_power_policy.cpp +++ b/services/src/sensor_power_policy.cpp @@ -47,7 +47,7 @@ ErrCode SensorPowerPolicy::SuspendSensors(int32_t pid) CALL_LOG_ENTER; std::vector sensorIdList = clientInfo_.GetSensorIdByPid(pid); if (sensorIdList.empty()) { - SEN_HILOGI("Suspend sensors failed, sensorIdList is empty, pid:%{public}d", pid); + SEN_HILOGD("Suspend sensors failed, sensorIdList is empty, pid:%{public}d", pid); return SUSPEND_ERR; } std::lock_guard pidSensorInfoLock(pidSensorInfoMutex_); @@ -107,7 +107,7 @@ ErrCode SensorPowerPolicy::ResumeSensors(int32_t pid) std::lock_guard pidSensorInfoLock(pidSensorInfoMutex_); auto pidSensorInfoIt = pidSensorInfoMap_.find(pid); if (pidSensorInfoIt == pidSensorInfoMap_.end()) { - SEN_HILOGI("Resume sensors failed, please suspend sensors first, pid:%{public}d", pid); + SEN_HILOGD("Resume sensors failed, please suspend sensors first, pid:%{public}d", pid); return RESUME_ERR; } bool isAllResume = true;