mirror of https://github.com/axmolengine/axmol.git
fixed #3868. Add guard check to send method of HttpClient
This commit is contained in:
parent
0cfb5169a4
commit
629c6b9a89
|
@ -469,12 +469,14 @@ void HttpClient::send(HttpRequest* request)
|
|||
|
||||
request->retain();
|
||||
|
||||
s_requestQueueMutex.lock();
|
||||
s_requestQueue->pushBack(request);
|
||||
s_requestQueueMutex.unlock();
|
||||
|
||||
// Notify thread start to work
|
||||
s_SleepCondition.notify_one();
|
||||
if (nullptr != s_requestQueue) {
|
||||
s_requestQueueMutex.lock();
|
||||
s_requestQueue->pushBack(request);
|
||||
s_requestQueueMutex.unlock();
|
||||
|
||||
// Notify thread start to work
|
||||
s_SleepCondition.notify_one();
|
||||
}
|
||||
}
|
||||
|
||||
// Poll and notify main thread if responses exists in queue
|
||||
|
|
Loading…
Reference in New Issue