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 266187 f16daa2effd1
parent 266186 a75365b95a17
child 266188 634d32969bd6
push id4780
push userryanvm@gmail.com
push date2015-06-04 17:55 +0000
treeherdermozilla-beta@62bb5056f458 [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;
 }