diff --git a/services/src/sensor_service.cpp b/services/src/sensor_service.cpp index 3ede64e3f7517d35aa48ccbae8131532ab945133..e9b6d22f1b22a17747793a7c47a2b034512dd858 100644 --- a/services/src/sensor_service.cpp +++ b/services/src/sensor_service.cpp @@ -523,6 +523,7 @@ void SensorService::ProcessDeathObserver(const wptr &object) SEN_HILOGE("pid is invalid"); return; } + POWER_POLICY.DeleteDeathPidSensorInfo(pid); SEN_HILOGI("pid is %{public}d", pid); std::vector activeSensors = clientInfo_.GetSensorIdByPid(pid); for (size_t i = 0; i < activeSensors.size(); ++i) { @@ -536,7 +537,6 @@ void SensorService::ProcessDeathObserver(const wptr &object) clientInfo_.DestroySensorChannel(pid); clientInfo_.DestroyClientPid(client); clientInfo_.DestroyCmd(clientInfo_.GetUidByPid(pid)); - POWER_POLICY.DeleteDeathPidSensorInfo(pid); } void SensorService::RegisterClientDeathRecipient(sptr sensorClient, int32_t pid)