Commit dc53098e authored by Max Kellermann's avatar Max Kellermann

lib/curl/Request: allow Stop() to be called twice

Convert assertion to runtime check. This is useful because this is a public method, and the caller has no chance to check if the object is still registered.
parent 3c66feff
......@@ -81,7 +81,8 @@ CurlRequest::Start()
void
CurlRequest::Stop()
{
assert(registered);
if (!registered)
return;
global.Remove(easy.Get());
registered = false;
......@@ -93,8 +94,7 @@ CurlRequest::FreeEasy()
if (!easy)
return;
if (registered)
Stop();
Stop();
easy = nullptr;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment