Bug 1451262 - Call NS_ProcessPendingEvents after StopSSLServerCertVerificationThreads
If there are still pending events after we null out gSocketThread, OnSocketThread() will always return false, which can trigger assertions.
MozReview-Commit-ID: CovFIU3cKL
--- a/netwerk/base/nsSocketTransportService2.cpp
+++ b/netwerk/base/nsSocketTransportService2.cpp
@@ -1062,17 +1062,22 @@ nsSocketTransportService::Run()
// detach all sockets, including locals
Reset(false);
// Final pass over the event queue. This makes sure that events posted by
// socket detach handlers get processed.
NS_ProcessPendingEvents(mRawThread);
+ // Stopping the SLL threads can generate new events, so we need to
+ // process them before nulling out gSocketThread, otherwise we can get
+ // !onSocketThread assertions.
psm::StopSSLServerCertVerificationThreads();
+ NS_ProcessPendingEvents(mRawThread);
+
gSocketThread = nullptr;
SOCKET_LOG(("STS thread exit\n"));
return NS_OK;
}
void