Bug 1452417 - Hold a ref to mRequest in PACResolver::Notify. r=bagder, a=abillings
authorValentin Gosu <valentin.gosu@gmail.com>
Tue, 10 Apr 2018 22:07:47 +0200
changeset 463238 364fadf112db6f66de1ac7916e3b6a8a992ea53d
parent 463237 df8719ae5e6f23c63e7d86bc971ecec74c3ee0b9
child 463239 ad91b3bde301ba2bd4e5c32f0551066104efcc0f
push id1683
push usersfraser@mozilla.com
push dateThu, 26 Apr 2018 16:43:40 +0000
treeherdermozilla-release@5af6cb21869d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbagder, abillings
bugs1452417
milestone60.0
Bug 1452417 - Hold a ref to mRequest in PACResolver::Notify. r=bagder, a=abillings 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");