diff --git a/src/Curl/Multi.jl b/src/Curl/Multi.jl index d2be032..26c476c 100644 --- a/src/Curl/Multi.jl +++ b/src/Curl/Multi.jl @@ -25,8 +25,18 @@ function done!(multi::Multi) stoptimer!(multi) handle = multi.handle handle == C_NULL && return - multi.handle = C_NULL - curl_multi_cleanup(handle) + # Starting from LibCURL v8.10 we have to keep the handle non-NULL before calling the + # cleanup function (), but doing + # so with Curl v8.10 causes an assertion failure + # (), + # that's fixed only with curl 8.11. + @static if CURL_VERSION < v"8.11" + multi.handle = C_NULL + curl_multi_cleanup(handle) + else + curl_multi_cleanup(handle) + multi.handle = C_NULL + end nothing end