1curl_global_cleanup(3) libcurl Manual curl_global_cleanup(3)
2
3
4
6 curl_global_cleanup - global libcurl cleanup
7
9 #include <curl/curl.h>
10
11 void curl_global_cleanup(void);
12
14 This function releases resources acquired by curl_global_init(3).
15
16 You should call curl_global_cleanup(3) once for each call you make to
17 curl_global_init(3), after you are done using libcurl.
18
19 This function is thread-safe since libcurl 7.84.0 if curl_ver‐
20 sion_info(3) has the CURL_VERSION_THREADSAFE feature bit set (most
21 platforms).
22
23 If this is not thread-safe, you must not call this function when any
24 other thread in the program (i.e. a thread sharing the same memory) is
25 running. This does not just mean no other thread that is using
26 libcurl. Because curl_global_cleanup(3) calls functions of other li‐
27 braries that are similarly thread unsafe, it could conflict with any
28 other thread that uses these other libraries.
29
30 See the description in libcurl(3) of global environment requirements
31 for details of how to use this function.
32
34 curl_global_cleanup(3) does not block waiting for any libcurl-created
35 threads to terminate (such as threads used for name resolving). If a
36 module containing libcurl is dynamically unloaded while libcurl-created
37 threads are still running then your program may crash or other corrup‐
38 tion may occur. We recommend you do not run libcurl from any module
39 that may be unloaded dynamically. This behavior may be addressed in the
40 future.
41
43 curl_global_init(CURL_GLOBAL_DEFAULT);
44
45 /* use libcurl, then before exiting... */
46
47 curl_global_cleanup();
48
50 Added in 7.8
51
53 None
54
56 curl_global_init(3), libcurl(3), libcurl-thread(3),
57
58
59
60libcurl 7.85.0 June 15, 2022 curl_global_cleanup(3)