Skip to content

Commit f02037b

Browse files
committed
add destructor to winc1500 class
1 parent ce94d15 commit f02037b

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

AdafruitIO_WINC1500.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@ AdafruitIO_WINC1500::AdafruitIO_WINC1500(const __FlashStringHelper *ssid, const
2020
_mqtt = new Adafruit_MQTT_Client(_client, _host, _port);
2121
}
2222

23+
AdafruitIO_WINC1500::~AdafruitIO_WINC1500()
24+
{
25+
if(_client)
26+
delete _client;
27+
if(_mqtt)
28+
delete _mqtt;
29+
}
30+
2331
void AdafruitIO_WINC1500::_connect()
2432
{
2533

AdafruitIO_WINC1500.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ class AdafruitIO_WINC1500 : public AdafruitIO {
2020
public:
2121
AdafruitIO_WINC1500(const char *ssid, const char *pass);
2222
AdafruitIO_WINC1500(const __FlashStringHelper *ssid, const __FlashStringHelper *pass);
23+
~AdafruitIO_WINC1500();
24+
2325
aio_status_t networkStatus();
2426

2527
protected:

0 commit comments

Comments
 (0)