1--- 2c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al. 3SPDX-License-Identifier: curl 4Title: curl_multi_cleanup 5Section: 3 6Source: libcurl 7See-also: 8 - curl_easy_cleanup (3) 9 - curl_easy_init (3) 10 - curl_multi_get_handles (3) 11 - curl_multi_init (3) 12Protocol: 13 - All 14--- 15 16# NAME 17 18curl_multi_cleanup - close down a multi session 19 20# SYNOPSIS 21 22~~~c 23#include <curl/curl.h> 24 25CURLMcode curl_multi_cleanup(CURLM *multi_handle); 26~~~ 27 28# DESCRIPTION 29 30Cleans up and removes a whole multi stack. It does not free or touch any 31individual easy handles in any way - they still need to be closed 32individually, using the usual curl_easy_cleanup(3) way. The order of 33cleaning up should be: 34 351 - curl_multi_remove_handle(3) before any easy handles are cleaned up 36 372 - curl_easy_cleanup(3) can now be called independently since the easy 38handle is no longer connected to the multi handle 39 403 - curl_multi_cleanup(3) should be called when all easy handles are 41removed 42 43Passing in a NULL pointer in *multi_handle* makes this function return 44CURLM_BAD_HANDLE immediately with no other action. 45 46# EXAMPLE 47 48~~~c 49int main(void) 50{ 51 CURLM *multi = curl_multi_init(); 52 53 /* when the multi transfer is done ... */ 54 55 /* remove all easy handles, then: */ 56 curl_multi_cleanup(multi); 57} 58~~~ 59 60# AVAILABILITY 61 62Added in 7.9.6 63 64# RETURN VALUE 65 66CURLMcode type, general libcurl multi interface error code. On success, 67CURLM_OK is returned. 68