From 031c0c3e228d5ba2fbb5b93122ed8dc56021f025 Mon Sep 17 00:00:00 2001 From: tastytea Date: Wed, 10 Apr 2019 21:04:04 +0200 Subject: [PATCH] Catch path by value in request_stream(). --- src/http.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/http.cpp b/src/http.cpp index 6140080..80f482f 100644 --- a/src/http.cpp +++ b/src/http.cpp @@ -61,8 +61,8 @@ void API::http::request_stream(const string &path, string &stream) { static return_call ret; _streamthread = std::thread( - [&] - { + [&, path] // path is captured by value because it may be + { // deleted before we access it. ret = request_common(http_method::GET_STREAM, path, curlpp::Forms(), stream); if (!ret)