Skip to content

Commit

Permalink
Set Multi handle to NULL after calling curl_multi_cleanup (#266)
Browse files Browse the repository at this point in the history
  • Loading branch information
giordano authored Jan 5, 2025
1 parent 91a71b9 commit e692e77
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/Curl/Multi.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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 (<https://github.com/JuliaLang/Downloads.jl/issues/260>), but doing
# so with Curl v8.10 causes an assertion failure
# (<https://github.com/JuliaLang/Downloads.jl/issues/260#issuecomment-2452772273>),
# 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

Expand Down

0 comments on commit e692e77

Please sign in to comment.