1--- 2c: Copyright (C) Daniel Stenberg, <daniel.se>, et al. 3SPDX-License-Identifier: curl 4Title: curl_share_cleanup 5Section: 3 6Source: libcurl 7See-also: 8 - curl_share_init (3) 9 - curl_share_setopt (3) 10--- 11 12# NAME 13 14curl_share_cleanup - Clean up a shared object 15 16# SYNOPSIS 17 18~~~c 19#include <curl/curl.h> 20 21CURLSHcode curl_share_cleanup(CURLSH *share_handle); 22~~~ 23 24# DESCRIPTION 25 26This function deletes a shared object. The share handle cannot be used anymore 27when this function has been called. 28 29Passing in a NULL pointer in *share_handle* makes this function return 30immediately with no action. 31 32# EXAMPLE 33 34~~~c 35int main(void) 36{ 37 CURLSHcode sh; 38 CURLSH *share = curl_share_init(); 39 sh = curl_share_setopt(share, CURLSHOPT_SHARE, CURL_LOCK_DATA_CONNECT); 40 /* use the share, then ... */ 41 curl_share_cleanup(share); 42} 43~~~ 44 45# AVAILABILITY 46 47Added in 7.10 48 49# RETURN VALUE 50 51CURLSHE_OK (zero) means that the option was set properly, non-zero means an 52error occurred as *<curl/curl.h>* defines. See the libcurl-errors(3) 53man page for the full list with descriptions. If an error occurs, then the 54share object is not deleted. 55