diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2014-05-30 17:32:09 +0200 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2014-05-30 17:32:09 +0200 |
commit | d5e63cea21932dbc03e513e205f0f3c66cc8c350 (patch) | |
tree | efdd592418a864c7843a638b5e3c32ee4f964803 /common | |
parent | 78fda8bb62a85fe0a536d2f38832a6123739e4c1 (diff) | |
download | qtlocation-mapboxgl-d5e63cea21932dbc03e513e205f0f3c66cc8c350.tar.gz |
retain the uv loop until all things deconstructed
fixes #261
Diffstat (limited to 'common')
-rw-r--r-- | common/curl_request.cpp | 4 | ||||
-rw-r--r-- | common/foundation_request.mm | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/common/curl_request.cpp b/common/curl_request.cpp index 0702e1e720..7eae7fd95e 100644 --- a/common/curl_request.cpp +++ b/common/curl_request.cpp @@ -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); diff --git a/common/foundation_request.mm b/common/foundation_request.mm index ca32706bad..4d6ca9c5fe 100644 --- a/common/foundation_request.mm +++ b/common/foundation_request.mm @@ -41,7 +41,7 @@ class FoundationRequest : public llmr::platform::Request { public: FoundationRequest(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) { #if TARGET_OS_IPHONE active_tasks++; @@ -68,7 +68,7 @@ public: std::shared_ptr<llmr::platform::Request> llmr::platform::request_http(const std::string &url, std::function<void(Response *)> callback, - uv_loop_t *loop) { + std::shared_ptr<uv::loop> loop) { uv_once(&request_initialize, request_initialize_cb); std::shared_ptr<FoundationRequest> req = @@ -99,7 +99,7 @@ llmr::platform::request_http(const std::string &url, } (*req_ptr)->complete(); - + delete req_ptr; }]; |