mirror of https://github.com/axmolengine/axmol.git
Merge pull request #5466 from andyque/bug3868
closed #3868. when singleton deleted, it should not dispatch callbacks. This PR resolves: Possible crash on repeat running between HttpClientTest, WebSocketTest, SocketIOTest.
This commit is contained in:
commit
ffb815d5e6
|
@ -214,8 +214,10 @@ void HttpClient::networkThread()
|
||||||
s_responseQueue->pushBack(response);
|
s_responseQueue->pushBack(response);
|
||||||
s_responseQueueMutex.unlock();
|
s_responseQueueMutex.unlock();
|
||||||
|
|
||||||
|
if (nullptr != s_pHttpClient) {
|
||||||
scheduler->performFunctionInCocosThread(CC_CALLBACK_0(HttpClient::dispatchResponseCallbacks, this));
|
scheduler->performFunctionInCocosThread(CC_CALLBACK_0(HttpClient::dispatchResponseCallbacks, this));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// cleanup: if worker thread received quit signal, clean up un-completed request queue
|
// cleanup: if worker thread received quit signal, clean up un-completed request queue
|
||||||
s_requestQueueMutex.lock();
|
s_requestQueueMutex.lock();
|
||||||
|
|
Loading…
Reference in New Issue