diff --git a/cocos/scripting/lua-bindings/manual/network/lua_xml_http_request.cpp b/cocos/scripting/lua-bindings/manual/network/lua_xml_http_request.cpp index 3862c9fd0c..df1514c1c5 100644 --- a/cocos/scripting/lua-bindings/manual/network/lua_xml_http_request.cpp +++ b/cocos/scripting/lua-bindings/manual/network/lua_xml_http_request.cpp @@ -59,6 +59,7 @@ LuaMinXmlHttpRequest::~LuaMinXmlHttpRequest() { _httpHeader.clear(); _requestHeader.clear(); + CC_SAFE_RELEASE_NULL(_httpRequest); } /** @@ -268,7 +269,7 @@ void LuaMinXmlHttpRequest::_sendRequest() release(); }); network::HttpClient::getInstance()->sendImmediate(_httpRequest); - _httpRequest->release(); + CC_SAFE_RELEASE_NULL(_httpRequest); retain(); }