!658 crash problem modification

Merge pull request !658 from 白露/master
This commit is contained in:
openharmony_ci 2024-10-18 08:11:58 +00:00 committed by Gitee
commit 7f8b5b183a
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 4 additions and 2 deletions

View File

@ -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;
}
}
}

View File

@ -47,7 +47,7 @@ ErrCode SensorPowerPolicy::SuspendSensors(int32_t pid)
CALL_LOG_ENTER;
std::vector<int32_t> 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<std::mutex> pidSensorInfoLock(pidSensorInfoMutex_);
@ -107,7 +107,7 @@ ErrCode SensorPowerPolicy::ResumeSensors(int32_t pid)
std::lock_guard<std::mutex> 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;