From b2c678877c04428f06ec5f1f59cc4d204bcd05ec Mon Sep 17 00:00:00 2001 From: chuck todd Date: Wed, 29 Jan 2020 03:18:54 -0700 Subject: [PATCH] std::shared_ptr Memory Leak (#3680) * 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 --- libraries/WiFi/src/WiFiClient.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/WiFi/src/WiFiClient.cpp b/libraries/WiFi/src/WiFiClient.cpp index e422b636..3913208b 100644 --- a/libraries/WiFi/src/WiFiClient.cpp +++ b/libraries/WiFi/src/WiFiClient.cpp @@ -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; }