Skip to content

Commit b8f4fe0

Browse files
committed
add destructor to base class
1 parent b90494a commit b8f4fe0

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

AdafruitIO.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,21 @@ AdafruitIO::AdafruitIO()
1111
_throttle_sub = 0;
1212
}
1313

14+
AdafruitIO::~AdafruitIO()
15+
{
16+
if(_err_topic)
17+
free(_err_topic);
18+
19+
if(_throttle_topic)
20+
free(_throttle_topic);
21+
22+
if(_err_sub)
23+
delete _err_sub;
24+
25+
if(_throttle_sub)
26+
delete _throttle_sub;
27+
}
28+
1429
void AdafruitIO::connect(const char *user, const char *key)
1530
{
1631
_username = user;

0 commit comments

Comments
 (0)