Fix dead lock when post new http request on failure callback

This commit is contained in:
halx99 2023-03-06 12:13:12 +08:00
parent 65add9922c
commit bc0b7da754
1 changed files with 3 additions and 2 deletions

View File

@ -436,11 +436,12 @@ void HttpClient::dispatchResponseCallbacks()
if (_finishedResponseQueue.unsafe_empty())
return;
auto AX_UNUSED lck = _finishedResponseQueue.get_lock();
auto lck = _finishedResponseQueue.get_lock();
if (!_finishedResponseQueue.unsafe_empty())
{
HttpResponse* response = _finishedResponseQueue.front();
_finishedResponseQueue.pop_front();
_finishedResponseQueue.unsafe_pop_front();
lck.unlock();
invokeResposneCallbackAndRelease(response);
}
}