curl_global_cleanup.3 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. .\" **************************************************************************
  2. .\" * _ _ ____ _
  3. .\" * Project ___| | | | _ \| |
  4. .\" * / __| | | | |_) | |
  5. .\" * | (__| |_| | _ <| |___
  6. .\" * \___|\___/|_| \_\_____|
  7. .\" *
  8. .\" * Copyright (C) 1998 - 2022, Daniel Stenberg, <daniel@haxx.se>, et al.
  9. .\" *
  10. .\" * This software is licensed as described in the file COPYING, which
  11. .\" * you should have received as part of this distribution. The terms
  12. .\" * are also available at https://curl.se/docs/copyright.html.
  13. .\" *
  14. .\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell
  15. .\" * copies of the Software, and permit persons to whom the Software is
  16. .\" * furnished to do so, under the terms of the COPYING file.
  17. .\" *
  18. .\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
  19. .\" * KIND, either express or implied.
  20. .\" *
  21. .\" * SPDX-License-Identifier: curl
  22. .\" *
  23. .\" **************************************************************************
  24. .TH curl_global_cleanup 3 "17 Feb 2006" "libcurl 7.8" "libcurl Manual"
  25. .SH NAME
  26. curl_global_cleanup - global libcurl cleanup
  27. .SH SYNOPSIS
  28. .nf
  29. #include <curl/curl.h>
  30. void curl_global_cleanup(void);
  31. .fi
  32. .SH DESCRIPTION
  33. This function releases resources acquired by \fIcurl_global_init(3)\fP.
  34. You should call \fIcurl_global_cleanup(3)\fP once for each call you make to
  35. \fIcurl_global_init(3)\fP, after you are done using libcurl.
  36. This function is thread-safe since libcurl 7.84.0 if
  37. \fIcurl_version_info(3)\fP has the CURL_VERSION_THREADSAFE feature bit set
  38. (most platforms).
  39. If this is not thread-safe, you must not call this function when any other
  40. thread in the program (i.e. a thread sharing the same memory) is running.
  41. This does not just mean no other thread that is using libcurl. Because
  42. \fIcurl_global_cleanup(3)\fP calls functions of other libraries that are
  43. similarly thread unsafe, it could conflict with any other thread that uses
  44. these other libraries.
  45. See the description in \fIlibcurl(3)\fP of global environment requirements for
  46. details of how to use this function.
  47. .SH CAUTION
  48. \fIcurl_global_cleanup(3)\fP does not block waiting for any libcurl-created
  49. threads to terminate (such as threads used for name resolving). If a module
  50. containing libcurl is dynamically unloaded while libcurl-created threads are
  51. still running then your program may crash or other corruption may occur. We
  52. recommend you do not run libcurl from any module that may be unloaded
  53. dynamically. This behavior may be addressed in the future.
  54. .SH EXAMPLE
  55. .nf
  56. curl_global_init(CURL_GLOBAL_DEFAULT);
  57. /* use libcurl, then before exiting... */
  58. curl_global_cleanup();
  59. .fi
  60. .SH AVAILABILITY
  61. Added in 7.8
  62. .SH RETURN VALUE
  63. None
  64. .SH "SEE ALSO"
  65. .BR curl_global_init "(3), "
  66. .BR libcurl "(3), "
  67. .BR libcurl-thread "(3), "