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:
		@@ -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;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user