Quantcast
Channel: WE MOVED to github.com/microsoft/cpprestsdk. This site is not monitored!
Viewing all articles
Browse latest Browse all 4845

Commented Issue: extract_json() memory leak Reported [78]

$
0
0
Hi.

I've used v1.4 in my VC++(MFC) project. ( i solved dll unloaded problem - https://casablanca.codeplex.com/workitem/17 )
And I get a memory leak report.

I tested SDI Project with the following code in VS2013, VS2012

// URI
web::http::uri_builder request_uri;
request_uri.set_scheme(L"http");
request_uri.set_host(m_hostAddress.c_str());
request_uri.set_path(L"/user/login");
request_uri.append_query(L"apiKey", m_strAppKey.c_str());
request_uri.append_query(L"email", userID.c_str());
request_uri.append_query(L"passwd", userPassword.c_str());

// Request Message
web::http::http_request request(web::http::methods::POST);
request.set_request_uri(request_uri.to_string());

http_client client(request.request_uri());

client.request(request.method()).then([&](pplx::task<http_response> responseTask)
{
try
{
http_response response = responseTask.get();

if(response.status_code() == status_codes::OK)
{

pplx::task<web::json::value> previousTask = response.extract_json();
}
}
catch( const http_exception &e )
{

}
}).wait();

The same probliem appears in extract_string().

Comments: Hi jhillmann and simplyTom, See issue 17 where I describe a solution with MemStateHolder. Did you try that? The issue is pretty hard to solve without changing how MFC works.

Viewing all articles
Browse latest Browse all 4845

Latest Images

Trending Articles



Latest Images