curl_share_cleanup(3)
π curl_share_cleanup(3) β the libcurl manual, but make it make sense π
okay bestie, welcome to the Library Functions Manual for curl_share_cleanup β the page that tells you how to say bye-bye to a shared object, and she is short but she is important. β¨
πΈ NAME πΈ
curl_share_cleanup β close a shared object. that's it, that's the job. lowkey iconic for being that direct. π«Ά
π¦ SYNOPSIS π¦
#include <curl/curl.h>
CURLSHcode curl_share_cleanup(CURLSH *share_handle);
one header, one function, one pointer. clean lines, no notes. π
β DESCRIPTION β
so this function deletes a shared object. and once you've called it, the share handle is done β cannot be used anymore, periodt. that handle has left the chat. π
if you pass in a NULL pointer in share_handle, this function just returns immediately with no action at all. no drama, no crash, just vibes. π§
and ngl, this is the important one: any use of the share_handle after this function has been called and has returned is illegal. like, illegal illegal. do not touch, do not reference, do not even look at it. π
π PROTOCOLS π
this functionality affects all supported protocols β every single one, no cap. π
π EXAMPLE π
this is literally the whole lifecycle right here, look at her:
int main(void)
{
CURLSHcode sh;
CURLSH *share = curl_share_init();
sh = curl_share_setopt(share, CURLSHOPT_SHARE, CURL_LOCK_DATA_CONNECT);
/* use the share, then ... */
curl_share_cleanup(share);
}
init, setopt, use, cleanup. the main character arc. π
π AVAILABILITY π
added in curl 7.10 β she's been around a while, a true veteran. β
π₯ RETURN VALUE π₯
CURLSHE_OK (zero) means that the option was set properly. non-zero means an error occurred, as <curl/curl.h> defines. for the full list with descriptions, go check out the libcurl-errors(3) man page β it's giving encyclopedia but make it useful. π
heads up: if an error occurs, then the share object is not deleted. so yeah, she stays. π
π SEE ALSO π
the whole friend group, fr fr. π«Ά
okay that's the page!! β¨ this was libcurl, dated 2026-10-12, and this specific slice of documentation is curl_share_cleanup(3). now go forth and clean up your shares responsibly, bestie β mwah ππ
π¦ where this page comes from
- fedora 44: libcurl-devel 8.18.0-14.fc44 Β· curl
- fedora 44: libcurl-devel 8.18.0-14.fc44 Β· curl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms