Skip to content

Commit

Permalink
Added a destructor to free up memory.
Browse files Browse the repository at this point in the history
  • Loading branch information
jasiek committed Mar 2, 2024
1 parent acd9196 commit f2cd260
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/protocols/Pager/Pager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ PagerClient::PagerClient(PhysicalLayer* phy) {
filterNumAddresses = 1;
}

PagerClient::~PagerClient() {
delete[] filterAddresses;
}

int16_t PagerClient::begin(float base, uint16_t speed, bool invert, uint16_t shift) {
// calculate duration of 1 bit in us
dataRate = (float)speed/1000.0f;
Expand Down
1 change: 1 addition & 0 deletions src/protocols/Pager/Pager.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ class PagerClient {
\param phy Pointer to the wireless module providing PhysicalLayer communication.
*/
explicit PagerClient(PhysicalLayer* phy);
~PagerClient();

// basic methods

Expand Down

0 comments on commit f2cd260

Please sign in to comment.