Bug 1452417 - Hold a ref to mRequest in PACResolver::Notify. r=bagder
authorValentin Gosu <valentin.gosu@gmail.com>
Tue, 10 Apr 2018 22:07:47 +0200
changeset 413245 f7fb95c9979452fe25e42873f54cf56a80a0a0d8
parent 413244 0d23d74448c8493ac96828ee757f0211c47a7b44
child 413246 6a53c90b362b4eb2243e07592ef4aff23ef6166f
push id33840
push userapavel@mozilla.com
push dateFri, 13 Apr 2018 21:56:54 +0000
treeherdermozilla-central@6547c27303bc [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbagder
bugs1452417
milestone61.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1452417 - Hold a ref to mRequest in PACResolver::Notify. r=bagder MozReview-Commit-ID: 1QeFlAiTCNt
netwerk/base/ProxyAutoConfig.cpp
--- a/netwerk/base/ProxyAutoConfig.cpp
+++ b/netwerk/base/ProxyAutoConfig.cpp
@@ -302,18 +302,19 @@ public:
     mStatus = status;
     mResponse = record;
     return NS_OK;
   }
 
   // nsITimerCallback
   NS_IMETHOD Notify(nsITimer *timer) override
   {
-    if (mRequest)
-      mRequest->Cancel(NS_ERROR_NET_TIMEOUT);
+    nsCOMPtr<nsICancelable> request(mRequest);
+    if (request)
+      request->Cancel(NS_ERROR_NET_TIMEOUT);
     mTimer = nullptr;
     return NS_OK;
   }
 
   // nsINamed
   NS_IMETHOD GetName(nsACString& aName) override
   {
     aName.AssignLiteral("PACResolver");