From 0a6933cc8cf114d701796cc860262483ed3f78ca Mon Sep 17 00:00:00 2001 From: Vincent Yang Date: Tue, 14 Jul 2015 10:46:17 +0800 Subject: [PATCH] Fixed #12668 : Lua-bindings-manual-network--LuaMinXmlHttpRequest have a memory leak. --- .../lua-bindings/manual/network/lua_xml_http_request.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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(); }