Skip to content

Commit

Permalink
Cleanup on destruction.
Browse files Browse the repository at this point in the history
  • Loading branch information
fire committed Aug 29, 2021
1 parent 99b8610 commit dcaf77d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions modules/mbedtls_curl/http_client_curl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,10 @@ Error HTTPClientCurl::connect_to_host(const String &p_host, int p_port, bool p_s
return OK;
}

HTTPClientCurl::~HTTPClientCurl() {
close();
}

void HTTPClientCurl::close() {
if (curl) {
curl_multi_cleanup(curl);
Expand Down
1 change: 1 addition & 0 deletions modules/mbedtls_curl/http_client_curl.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ class HTTPClientCurl : public HTTPClient {
virtual Error _request(IPAddress p_addr, bool p_init_dns);

public:
virtual ~HTTPClientCurl() override;
static HTTPClient *_create_func();

virtual Error connect_to_host(const String &p_host, int p_port = -1, bool p_ssl = false, bool p_verify_host = true) override;
Expand Down

0 comments on commit dcaf77d

Please sign in to comment.