diff --git a/frameworks/native/sensor/include/sensor_agent_proxy.h b/frameworks/native/sensor/include/sensor_agent_proxy.h index f3795ce655083c8522dbbcd62b18baba5581bf6b..d39d9b7cf612e4e73eb89edc695a7f0fe98c1d98 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 ca3a186109f7ee46661957164776b2fee1164b12..e3a1eebe895ca5d0647aaba9f40f5bc2f13e3400 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__);