diff --git a/cocos/network/HttpClient.cpp b/cocos/network/HttpClient.cpp index fbf8c9fd6c..15a1931c5b 100644 --- a/cocos/network/HttpClient.cpp +++ b/cocos/network/HttpClient.cpp @@ -181,8 +181,7 @@ void HttpClient::networkThreadAlone(HttpRequest* request) processResponse(response, errorBuffer); auto scheduler = Director::getInstance()->getScheduler(); - scheduler->performFunctionInCocosThread([response]{ - auto request = response->getHttpRequest(); + scheduler->performFunctionInCocosThread([response, request]{ const ccHttpRequestCallback& callback = request->getCallback(); Ref* pTarget = request->getTarget(); SEL_HttpResponse pSelector = request->getSelector();