From 05bd3e465f950347387a75fe11122184dab81fb6 Mon Sep 17 00:00:00 2001 From: SUE Date: Wed, 9 Mar 2022 09:13:33 +0000 Subject: [PATCH] Signed-off-by:hellohyh001 --- frameworks/native/sensor/include/sensor_agent_proxy.h | 2 +- frameworks/native/sensor/src/sensor_agent_proxy.cpp | 8 -------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/frameworks/native/sensor/include/sensor_agent_proxy.h b/frameworks/native/sensor/include/sensor_agent_proxy.h index f3795ce6..d39d9b7c 100644 --- a/frameworks/native/sensor/include/sensor_agent_proxy.h +++ b/frameworks/native/sensor/include/sensor_agent_proxy.h @@ -32,7 +32,7 @@ typedef int32_t (*SensorDataCallback)(struct SensorNativeData *events, uint32_t struct SensorAgentProxy : public OHOS::RefBase { public: SensorAgentProxy(); - ~SensorAgentProxy(); + ~SensorAgentProxy() = default; static const SensorAgentProxy *GetSensorsObj(); int32_t ActivateSensor(int32_t sensorId, const SensorUser *user) const; int32_t DeactivateSensor(int32_t sensorId, const SensorUser *user) const; diff --git a/frameworks/native/sensor/src/sensor_agent_proxy.cpp b/frameworks/native/sensor/src/sensor_agent_proxy.cpp index ca3a1861..e3a1eebe 100644 --- a/frameworks/native/sensor/src/sensor_agent_proxy.cpp +++ b/frameworks/native/sensor/src/sensor_agent_proxy.cpp @@ -79,14 +79,6 @@ SensorAgentProxy::SensorAgentProxy() : dataChannel_(new (std::nothrow) SensorDataChannel()) {} -SensorAgentProxy::~SensorAgentProxy() -{ - if (sensorObj_ != nullptr) { - delete sensorObj_; - sensorObj_ = nullptr; - } -} - const SensorAgentProxy *SensorAgentProxy::GetSensorsObj() { HiLog::Debug(LABEL, "%{public}s", __func__); -- Gitee