retain the uv loop until all things deconstructed

fixes #261
This commit is contained in:
Konstantin Käfer
2014-05-30 17:32:09 +02:00
parent 78fda8bb62
commit d5e63cea21
8 changed files with 44 additions and 26 deletions

View File

@@ -89,7 +89,7 @@ class CURLRequest : public llmr::platform::Request {
public:
CURLRequest(const std::string &url,
std::function<void(llmr::platform::Response *)> callback,
uv_loop_t *loop)
std::shared_ptr<uv::loop> loop)
: Request(url, callback, loop) {}
CURL *curl = nullptr;
@@ -358,7 +358,7 @@ void thread_init_cb() {
std::shared_ptr<platform::Request>
platform::request_http(const std::string &url,
std::function<void(Response *)> callback,
uv_loop_t *loop) {
std::shared_ptr<uv::loop> loop) {
using namespace request;
init_thread_once(thread_init_cb);
std::shared_ptr<CURLRequest> req = std::make_shared<CURLRequest>(url, callback, loop);