diff --git a/netwerk/base/nsIOService.cpp b/netwerk/base/nsIOService.cpp index 89f30b196b9e..0f3e48edd480 100644 --- a/netwerk/base/nsIOService.cpp +++ b/netwerk/base/nsIOService.cpp @@ -37,6 +37,7 @@ #include "nsINode.h" #include "nsIWidget.h" #include "nsThreadUtils.h" +#include "mozilla/AppShutdown.h" #include "mozilla/LoadInfo.h" #include "mozilla/net/NeckoCommon.h" #include "mozilla/Services.h" @@ -514,7 +515,8 @@ nsresult nsIOService::LaunchSocketProcess() { return NS_OK; } - if (mShutdown) { + // We shouldn't launch socket prcess when shutdown begins. + if (AppShutdown::IsInOrBeyond(ShutdownPhase::AppShutdownConfirmed)) { return NS_OK; } diff --git a/netwerk/ipc/SocketProcessBridgeChild.cpp b/netwerk/ipc/SocketProcessBridgeChild.cpp index 08f16f2e4b2f..ec7f45b05245 100644 --- a/netwerk/ipc/SocketProcessBridgeChild.cpp +++ b/netwerk/ipc/SocketProcessBridgeChild.cpp @@ -6,6 +6,7 @@ #include "SocketProcessBridgeChild.h" #include "SocketProcessLogging.h" +#include "mozilla/AppShutdown.h" #include "mozilla/dom/ContentChild.h" #include "mozilla/ipc/BackgroundChild.h" #include "mozilla/ipc/Endpoint.h" @@ -156,7 +157,8 @@ mozilla::ipc::IPCResult SocketProcessBridgeChild::RecvTest() { void SocketProcessBridgeChild::ActorDestroy(ActorDestroyReason aWhy) { LOG(("SocketProcessBridgeChild::ActorDestroy\n")); if (AbnormalShutdown == aWhy) { - if (gNeckoChild) { + if (gNeckoChild && + !AppShutdown::IsInOrBeyond(ShutdownPhase::AppShutdownConfirmed)) { // Let NeckoParent know that the socket process connections must be // rebuilt. gNeckoChild->SendResetSocketProcessBridge();