gnurl_global_cleanup(3)

πŸ“¦ version 7.72.0, in nixos 26.05, nixpkgs unstable

πŸ¦‹ gnurl_global_cleanup(3) πŸ¦‹

okay so this page is from the libgnurl Manual, and it's literally your guide to curl_global_cleanup β€” the β€œwe're done here, clean up your mess” function πŸ’…βœ¨


πŸŽ€ NAME πŸŽ€

curl_global_cleanup β€” global libcurl cleanup, no cap πŸ§ΉπŸ’–


✨ SYNOPSIS ✨

#include <gnurl/curl.h>

void curl_global_cleanup(void);

πŸ’– DESCRIPTION πŸ’–

bestie, this function releases resources acquired by curl_global_init(3). that's the whole vibe: it's the cleanup era 🧼🫢

You should call curl_global_cleanup(3) once for each call you make to curl_global_init(3), after you are done using libcurl. one init, one cleanup β€” matching set, periodt πŸ’…

⚠️ thread-safety warning, bestie ⚠️ This function is not thread safe. You must not call it when any other thread in the program (i.e. a thread sharing the same memory) is running.

and no, that doesn’t just mean no other thread that is using libcurl 😭 This doesn't just mean no other thread that is using libcurl. Because curl_global_cleanup(3) calls functions of other libraries that are similarly thread unsafe, it could conflict with any other thread that uses these other libraries. so yeah, the whole program needs to be chill before you hit this πŸ’€

See the description in libcurl(3) of global environment requirements for details of how to use this function. fr fr, go read that if you want the full lore πŸ“šπŸ‘‘


🚨 CAUTION 🚨

curl_global_cleanup(3) does not block waiting for any libcurl-created threads to terminate (such as threads used for name resolving). like, it is not gonna sit there and wait for them to finish β€” it's not that kind of function πŸ™ˆ

If a module containing libcurl is dynamically unloaded while libcurl-created threads are still running then your program may crash or other corruption may occur. and we are not trying to have corruption today, bestie πŸ˜­πŸ’€

We recommend you do not run libcurl from any module that may be unloaded dynamically. This behavior may be addressed in the future. so for now, keep libcurl in a module that stays put, okay? 🫢✨


🫢 SEE ALSO 🫢

(yes, the original list ends with a lil trailing comma after libcurl-thread(3), β€” we keep the details exactly as they are, iykyk πŸ’…)


mwah πŸ’‹ β€” cute little footer sign-off: this iconic page is libcurl 7.8, dated 17 Feb 2006 πŸŽ€β­

πŸ“¦ where this page comes from