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.
This commit is contained in:
parent
3c66feff5a
commit
dc53098e43
@ -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,8 +94,7 @@ CurlRequest::FreeEasy()
|
|||||||
if (!easy)
|
if (!easy)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (registered)
|
Stop();
|
||||||
Stop();
|
|
||||||
easy = nullptr;
|
easy = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user