Skip to content

Commit

Permalink
Destructor must be public
Browse files Browse the repository at this point in the history
  • Loading branch information
Will Tatam committed Jan 15, 2025
1 parent 59a79a3 commit 0afd2fe
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
12 changes: 6 additions & 6 deletions usermods/AHT10_v2/AHT10_v2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,6 @@ class UsermodAHT10 : public Usermod
_lastTemperature = 0;
}

~UsermodAHT10()
{
delete _aht;
_aht = nullptr;
}

#ifndef WLED_DISABLE_MQTT
void mqttInitialize()
{
Expand Down Expand Up @@ -322,6 +316,12 @@ class UsermodAHT10 : public Usermod
_initDone = true;
return configComplete;
}

~UsermodAHT10()
{
delete _aht;
_aht = nullptr;
}
};

const char UsermodAHT10::_name[] PROGMEM = "AHTxx";
Expand Down
13 changes: 7 additions & 6 deletions usermods/INA226_v2/INA226_v2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,12 +210,6 @@ class UsermodINA226 : public Usermod
}
}

~UsermodINA226()
{
delete _ina226;
_ina226 = nullptr;
}

#ifndef WLED_DISABLE_MQTT
void mqttInitialize()
{
Expand Down Expand Up @@ -551,6 +545,13 @@ class UsermodINA226 : public Usermod
_initDone = true;
return configComplete;
}

~UsermodINA226()
{
delete _ina226;
_ina226 = nullptr;
}

};

const char UsermodINA226::_name[] PROGMEM = "INA226";
Expand Down
2 changes: 1 addition & 1 deletion usermods/mqtt_switch_v2/mqtt_switch_v2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,5 +159,5 @@ inline void UsermodMqttSwitch::updateState(uint8_t pinNr)
}


static UsermodMqttSwitc mqtt_switch_v2;
static UsermodMqttSwitch mqtt_switch_v2;
REGISTER_USERMOD(mqtt_switch_v2);

0 comments on commit 0afd2fe

Please sign in to comment.