Skip to content

Commit 0afd2fe

Browse files
author
Will Tatam
committed
Destructor must be public
1 parent 59a79a3 commit 0afd2fe

File tree

3 files changed

+14
-13
lines changed

3 files changed

+14
-13
lines changed

usermods/AHT10_v2/AHT10_v2.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,6 @@ class UsermodAHT10 : public Usermod
5454
_lastTemperature = 0;
5555
}
5656

57-
~UsermodAHT10()
58-
{
59-
delete _aht;
60-
_aht = nullptr;
61-
}
62-
6357
#ifndef WLED_DISABLE_MQTT
6458
void mqttInitialize()
6559
{
@@ -322,6 +316,12 @@ class UsermodAHT10 : public Usermod
322316
_initDone = true;
323317
return configComplete;
324318
}
319+
320+
~UsermodAHT10()
321+
{
322+
delete _aht;
323+
_aht = nullptr;
324+
}
325325
};
326326

327327
const char UsermodAHT10::_name[] PROGMEM = "AHTxx";

usermods/INA226_v2/INA226_v2.cpp

+7-6
Original file line numberDiff line numberDiff line change
@@ -210,12 +210,6 @@ class UsermodINA226 : public Usermod
210210
}
211211
}
212212

213-
~UsermodINA226()
214-
{
215-
delete _ina226;
216-
_ina226 = nullptr;
217-
}
218-
219213
#ifndef WLED_DISABLE_MQTT
220214
void mqttInitialize()
221215
{
@@ -551,6 +545,13 @@ class UsermodINA226 : public Usermod
551545
_initDone = true;
552546
return configComplete;
553547
}
548+
549+
~UsermodINA226()
550+
{
551+
delete _ina226;
552+
_ina226 = nullptr;
553+
}
554+
554555
};
555556

556557
const char UsermodINA226::_name[] PROGMEM = "INA226";

usermods/mqtt_switch_v2/mqtt_switch_v2.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -159,5 +159,5 @@ inline void UsermodMqttSwitch::updateState(uint8_t pinNr)
159159
}
160160

161161

162-
static UsermodMqttSwitc mqtt_switch_v2;
162+
static UsermodMqttSwitch mqtt_switch_v2;
163163
REGISTER_USERMOD(mqtt_switch_v2);

0 commit comments

Comments
 (0)