Fix leaks seen during http/tests/xmlhttprequest/access-control-basic-non-simple-allow...
authormrowe@apple.com <mrowe@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 1 Oct 2008 22:24:37 +0000 (22:24 +0000)
committermrowe@apple.com <mrowe@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 1 Oct 2008 22:24:37 +0000 (22:24 +0000)
Reviewed by Geoff Garen.

* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::didFinishLoadingPreflight): Balance the ref and GC protect
that we do during the loadRequestAsynchronously of the preflight request with a deref and
GC unprotect.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@37161 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/xml/XMLHttpRequest.cpp

index dd865ba..5ddc1e5 100644 (file)
@@ -1,3 +1,14 @@
+2008-10-01  Mark Rowe  <mrowe@apple.com>
+
+        Reviewed by Geoff Garen.
+
+        Fix leaks seen during http/tests/xmlhttprequest/access-control-basic-non-simple-allow.html.
+
+        * xml/XMLHttpRequest.cpp:
+        (WebCore::XMLHttpRequest::didFinishLoadingPreflight): Balance the ref and GC protect
+        that we do during the loadRequestAsynchronously of the preflight request with a deref and
+        GC unprotect.
+
 2008-10-01  David Hyatt  <hyatt@apple.com>
 
         Rename allowsScrolling/setAllowsScrolling to canHaveScrollbars/setCanHaveScrollbars to make it more
index 7ca6700..c4879e0 100644 (file)
@@ -1101,6 +1101,11 @@ void XMLHttpRequest::didFinishLoadingPreflight(SubresourceLoader* loader)
     // FIXME: this can probably be moved to didReceiveResponsePreflight.
     if (m_async)
         handleAsynchronousPreflightResult();
+
+    if (m_loader) {
+        deref();
+        gcUnprotectDOMObject(this);
+    }
 }
 
 void XMLHttpRequest::willSendRequest(SubresourceLoader*, ResourceRequest& request, const ResourceResponse& redirectResponse)