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() ...@@ -81,7 +81,8 @@ CurlRequest::Start()
void void
CurlRequest::Stop() CurlRequest::Stop()
{ {
assert(registered); if (!registered)
return;
global.Remove(easy.Get()); global.Remove(easy.Get());
registered = false; registered = false;
...@@ -93,7 +94,6 @@ CurlRequest::FreeEasy() ...@@ -93,7 +94,6 @@ CurlRequest::FreeEasy()
if (!easy) if (!easy)
return; return;
if (registered)
Stop(); Stop();
easy = nullptr; 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