From e7de92a54fc0060a072a8686ee561e56ff51d217 Mon Sep 17 00:00:00 2001 From: andyque Date: Wed, 26 Feb 2014 10:20:34 +0800 Subject: [PATCH] fixed #3868. when singleton delted, it should dispatch callbacks. --- cocos/network/HttpClient.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cocos/network/HttpClient.cpp b/cocos/network/HttpClient.cpp index 39f319746a..0cc792faeb 100644 --- a/cocos/network/HttpClient.cpp +++ b/cocos/network/HttpClient.cpp @@ -214,7 +214,9 @@ void HttpClient::networkThread() s_responseQueue->pushBack(response); s_responseQueueMutex.unlock(); - scheduler->performFunctionInCocosThread(CC_CALLBACK_0(HttpClient::dispatchResponseCallbacks, this)); + if (nullptr != s_pHttpClient) { + scheduler->performFunctionInCocosThread(CC_CALLBACK_0(HttpClient::dispatchResponseCallbacks, this)); + } } // cleanup: if worker thread received quit signal, clean up un-completed request queue