when perform curl_easy_perform curl_easy_cleanup so:
curl* peasy = nullptr; peasy = curl_easy_init(); if (peasy != nullptr) { curl_easy_setopt(peasy, curlopt_username, user.c_str()); curl_easy_setopt(peasy, curlopt_password, pass.c_str()); curl_easy_setopt(peasy, curlopt_url, urltoconnectto.c_str()); curl_easy_setopt(peasy, curlopt_writefunction, onreceivehttpresponse); curl_easy_perform(peasy); curl_easy_cleanup(peasy); } i notice in debugger address of peasy pointer , 0x2af0ad18 after curl_easy_cleanup still 0x2af0ad18.
do have set nullptr after? expect curl_easy_cleanup reset me???
http://curl.haxx.se/libcurl/c/curl_easy_cleanup.html
the function takes pointer, how expect change value of in local scope?
when call free(x), doesn't set set x null frees memory, , same thing curl_easy_cleanup doing. whether want set peasy nullptr or not afterwards you, possibly practice unnecessary depending on layout of code , whether peasy go out of scope anyway.
Comments
Post a Comment