diff --git a/requester.cpp b/requester.cpp index 75e30f4..5899762 100644 --- a/requester.cpp +++ b/requester.cpp @@ -30,6 +30,10 @@ requester::requester() { curl_easy_setopt(_h.get(), CURLOPT_WRITEFUNCTION, write_data); } +requester::~requester() { + curl_global_cleanup(); +} + std::string requester::get(const std::string &url) { curl_easy_setopt(_h.get(), CURLOPT_URL, url.c_str()); std::vector buf; diff --git a/requester.hpp b/requester.hpp index 95288f1..ca70fe0 100644 --- a/requester.hpp +++ b/requester.hpp @@ -20,6 +20,7 @@ class requester { // this class is a RAII class for a curl handle requester(); + ~requester(); // perform a http get request std::string get(const std::string& url);