Revision: 7006
Author: b...@google.com
Date: Wed Nov 18 14:14:10 2009
Log: Fix the XHR memory leak in a way that doesn't cause HtmlUnit to crash.

Patch by: bobv
Review by: rjrjr
http://code.google.com/p/google-web-toolkit/source/detail?r=7006

Modified:
  /trunk/user/src/com/google/gwt/xhr/client/XMLHttpRequest.java

=======================================
--- /trunk/user/src/com/google/gwt/xhr/client/XMLHttpRequest.java       Wed Nov 
 
18 12:14:35 2009
+++ /trunk/user/src/com/google/gwt/xhr/client/XMLHttpRequest.java       Wed Nov 
 
18 14:14:10 2009
@@ -113,7 +113,9 @@
    public final native void clearOnReadyStateChange() /*-{
      var self = this;
      $wnd.setTimeout(function() {
-      self.onreadystatechange = function(){};
+      // Using a function literal here leaks memory on ie6
+      // Using the same function object kills HtmlUnit
+      self.onreadystatechange = new Function();
      }, 0);
    }-*/;

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Reply via email to