diff --git a/lib/downloader.cpp b/lib/downloader.cpp index c45ed90f..3168f9e5 100644 --- a/lib/downloader.cpp +++ b/lib/downloader.cpp @@ -65,6 +65,13 @@ namespace HTTP{ return S; } + Downloader::~Downloader(){ +#ifdef SSL + if (ssl){S_SSL.close();} +#endif + S.close(); + } + /// Sends a request for the given URL, does no waiting. void Downloader::doRequest(const HTTP::URL &link, const std::string &method, const std::string &body){ diff --git a/lib/downloader.h b/lib/downloader.h index 35eef078..8ab1ab15 100644 --- a/lib/downloader.h +++ b/lib/downloader.h @@ -5,6 +5,7 @@ namespace HTTP{ class Downloader{ public: Downloader(); + ~Downloader(); std::string &data(); const std::string &const_data() const; void doRequest(const HTTP::URL &link, const std::string &method = "",