mirror of
https://github.com/esphome/esphome.git
synced 2026-10-06 19:06:37 +00:00
Activate owning-memory clang-tidy check (#1891)
* Activate owning-memory clang-tidy check * Lint * Lint * Fix issue with new NfcTag constructor * Update pointers for number and select * Add back the NOLINT to display buffer * Fix merge * DSMR fixes * Nextion fixes * Fix pipsolar * Fix lwip socket * Format * Change socket fix Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
co-authored by
Jesse Hills
parent
e0cff214b2
commit
a4867a00ea
@@ -75,10 +75,10 @@ void HttpRequestComponent::send(const std::vector<HttpRequestResponseTrigger *>
|
||||
}
|
||||
|
||||
#ifdef ARDUINO_ARCH_ESP8266
|
||||
WiFiClient *HttpRequestComponent::get_wifi_client_() {
|
||||
std::shared_ptr<WiFiClient> HttpRequestComponent::get_wifi_client_() {
|
||||
if (this->secure_) {
|
||||
if (this->wifi_client_secure_ == nullptr) {
|
||||
this->wifi_client_secure_ = new BearSSL::WiFiClientSecure();
|
||||
this->wifi_client_secure_ = std::make_shared<BearSSL::WiFiClientSecure>();
|
||||
this->wifi_client_secure_->setInsecure();
|
||||
this->wifi_client_secure_->setBufferSizes(512, 512);
|
||||
}
|
||||
@@ -86,7 +86,7 @@ WiFiClient *HttpRequestComponent::get_wifi_client_() {
|
||||
}
|
||||
|
||||
if (this->wifi_client_ == nullptr) {
|
||||
this->wifi_client_ = new WiFiClient();
|
||||
this->wifi_client_ = std::make_shared<WiFiClient>();
|
||||
}
|
||||
return this->wifi_client_;
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include <list>
|
||||
#include <map>
|
||||
#include <utility>
|
||||
#include <memory>
|
||||
|
||||
#ifdef ARDUINO_ARCH_ESP32
|
||||
#include <HTTPClient.h>
|
||||
@@ -51,9 +52,9 @@ class HttpRequestComponent : public Component {
|
||||
std::string body_;
|
||||
std::list<Header> headers_;
|
||||
#ifdef ARDUINO_ARCH_ESP8266
|
||||
WiFiClient *wifi_client_{nullptr};
|
||||
BearSSL::WiFiClientSecure *wifi_client_secure_{nullptr};
|
||||
WiFiClient *get_wifi_client_();
|
||||
std::shared_ptr<WiFiClient> wifi_client_;
|
||||
std::shared_ptr<BearSSL::WiFiClientSecure> wifi_client_secure_;
|
||||
std::shared_ptr<WiFiClient> get_wifi_client_();
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user