Bug 1169867 - nsXMLHttpRequest should use and free mProxy correctly. r=ehsan, a=abillings
authorAndrea Marchesini <amarchesini@mozilla.com>
Thu, 04 Jun 2015 15:04:09 +0100
changeset 267649 f16daa2effd1dd84fec1b93d076d60008a411288
parent 267648 a75365b95a1793646bf42bb268d75b35767bd563
child 267650 634d32969bd6b907fc85363b2a96baa4747cfe9d
push id830
push userraliiev@mozilla.com
push dateFri, 19 Jun 2015 19:24:37 +0000
treeherdermozilla-release@932614382a68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan, abillings
bugs1169867
milestone39.0
Bug 1169867 - nsXMLHttpRequest should use and free mProxy correctly. r=ehsan, a=abillings
dom/workers/XMLHttpRequest.cpp
--- a/dom/workers/XMLHttpRequest.cpp
+++ b/dom/workers/XMLHttpRequest.cpp
@@ -1938,18 +1938,18 @@ XMLHttpRequest::Open(const nsACString& a
 
   nsRefPtr<OpenRunnable> runnable =
     new OpenRunnable(mWorkerPrivate, mProxy, aMethod, aUrl, aUser, aPassword,
                      mBackgroundRequest, mWithCredentials,
                      mTimeout);
 
   mProxy->mOpening = true;
   if (!runnable->Dispatch(mWorkerPrivate->GetJSContext())) {
+    mProxy->mOpening = false;
     ReleaseProxy();
-    mProxy->mOpening = false;
     aRv.Throw(NS_ERROR_FAILURE);
     return;
   }
 
   mProxy->mOpening = false;
   mProxy->mIsSyncXHR = !aAsync;
 }