Skip to content

Commit

Permalink
std::shared_ptr Memory Leak (#3680)
Browse files Browse the repository at this point in the history
* std::shared_ptr Memory Leak

clientSocketHande and _rxBuffer are std::shared_ptr, the stop() call was not correctly releasing them and the operator= had similar problems fix for #3679

* operator= second attempt

* operator= third time
  • Loading branch information
stickbreaker authored Jan 29, 2020
1 parent ed220bd commit b2c6788
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libraries/WiFi/src/WiFiClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,8 @@ WiFiClient & WiFiClient::operator=(const WiFiClient &other)

void WiFiClient::stop()
{
clientSocketHandle = NULL;
_rxBuffer = NULL;
clientSocketHandle.reset(); // clientSocketHandle = NULL;
_rxBuffer.reset(); // _rxBuffer = NULL;
_connected = false;
}

Expand Down

0 comments on commit b2c6788

Please sign in to comment.