Skip to content

Commit ce94d15

Browse files
committed
add destructor to wiced class
1 parent cc5622c commit ce94d15

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

AdafruitIO_WICED.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,14 @@ AdafruitIO_WICED::AdafruitIO_WICED(const __FlashStringHelper *ssid, const __Flas
1818
_mqtt = new Adafruit_MQTT_Client(_client, _host, _port);
1919
}
2020

21+
AdafruitIO_WICED::~AdafruitIO_WICED()
22+
{
23+
if(_client)
24+
delete _client;
25+
if(_mqtt)
26+
delete _mqtt;
27+
}
28+
2129
void AdafruitIO_WICED::_connect()
2230
{
2331
Feather.connect(_ssid, _pass);

AdafruitIO_WICED.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ class AdafruitIO_WICED : public AdafruitIO {
1515
public:
1616
AdafruitIO_WICED(const char *ssid, const char *pass);
1717
AdafruitIO_WICED(const __FlashStringHelper *ssid, const __FlashStringHelper *pass);
18+
~AdafruitIO_WICED();
19+
1820
aio_status_t networkStatus();
1921

2022
protected:

0 commit comments

Comments
 (0)