You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xap-commits@incubator.apache.org by jm...@apache.org on 2007/10/05 09:24:51 UTC

svn commit: r582155 - /incubator/xap/trunk/codebase/src/xap/util/HttpUtils.js

Author: jmargaris
Date: Fri Oct  5 02:24:51 2007
New Revision: 582155

URL: http://svn.apache.org/viewvc?rev=582155&view=rev
Log:
fix for IE memory leak, remove closure on onreadystatechange 
and replace it with a pointer to a global empty function. 
(Can't set to null or delete, doesn't work)

Modified:
    incubator/xap/trunk/codebase/src/xap/util/HttpUtils.js

Modified: incubator/xap/trunk/codebase/src/xap/util/HttpUtils.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/codebase/src/xap/util/HttpUtils.js?rev=582155&r1=582154&r2=582155&view=diff
==============================================================================
--- incubator/xap/trunk/codebase/src/xap/util/HttpUtils.js (original)
+++ incubator/xap/trunk/codebase/src/xap/util/HttpUtils.js Fri Oct  5 02:24:51 2007
@@ -71,6 +71,8 @@
 	if (callback) {
 		request.onreadystatechange = function () {
 			if (request.readyState == 4) {
+				//fix IE closure memory leak
+				request.onreadystatechange = xap.util.HttpUtils.emptyFunction;
 				callback(request);
 			}
 		};
@@ -82,6 +84,8 @@
 	}
 	return request;
 };
+
+xap.util.HttpUtils.emptyFunction = function(){};
 
 xap.util.HttpUtils.get = function (url, callback) {
 	return xap.util.HttpUtils._sendHttpRequest("GET", url, callback);