curl_multi_cleanup(3) -- Linux man page
NAMEcurl_multi_cleanup - close down a multi session
DESCRIPTIONCleans up and removes a whole multi stack. It does not free or touch any individual easy handles in any way - they still need to be closed individually, using the usual curl_easy_cleanup(3) way. The order of cleaning up should be:
1 - curl_multi_remove_handle(3) before any easy handles are cleaned up
2 - curl_easy_cleanup(3) can now be called independently since the easy handle is no longer connected to the multi handle
3 - curl_multi_cleanup(3) should be called when all easy handles are removed
RETURN VALUECURLMcode type, general libcurl multi interface error code.