Bug 881413 - Avoid a race condition in HTTP shutdown by explicitly cancelling nsHttpConnectionMgr::mTimer when we shut down the socket thread. r=mcmanus, a=sledru
authorBenjamin Smedberg <benjamin@smedbergs.us>
Fri, 28 Feb 2014 16:40:38 -0800
changeset 183132 9c12e6cb3b5d2a28467bfcf2050116a047f0710c
parent 183131 fa6cb4c0421dd26a750d6a35a22483f332ddc2e6
child 183133 5e935f77e615690f52abb6774d6e41296c2549a5
push id3343
push userffxbld
push dateMon, 17 Mar 2014 21:55:32 +0000
treeherdermozilla-beta@2f7d3415f79f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmcmanus, sledru
bugs881413
milestone29.0a2
Bug 881413 - Avoid a race condition in HTTP shutdown by explicitly cancelling nsHttpConnectionMgr::mTimer when we shut down the socket thread. r=mcmanus, a=sledru
netwerk/protocol/http/nsHttpConnectionMgr.cpp
--- a/netwerk/protocol/http/nsHttpConnectionMgr.cpp
+++ b/netwerk/protocol/http/nsHttpConnectionMgr.cpp
@@ -2116,16 +2116,20 @@ nsHttpConnectionMgr::OnMsgShutdown(int32
 
     mCT.Enumerate(ShutdownPassCB, this);
 
     if (mTimeoutTick) {
         mTimeoutTick->Cancel();
         mTimeoutTick = nullptr;
         mTimeoutTickArmed = false;
     }
+    if (mTimer) {
+      mTimer->Cancel();
+      mTimer = nullptr;
+    }
 
     // signal shutdown complete
     nsRefPtr<nsIRunnable> runnable =
         new nsConnEvent(this, &nsHttpConnectionMgr::OnMsgShutdownConfirm,
                         0, param);
     NS_DispatchToMainThread(runnable);
 }