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 ff9edf9365f59790001aa1f7972e14406a01cf9a..832a34ed12ae170b4671c6ff8e36a9bf8a0f91eb 100755 --- 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__);