diff --git a/dom/clients/manager/ClientManagerService.cpp b/dom/clients/manager/ClientManagerService.cpp index 76ecb97a367d..afbd86116996 100644 --- a/dom/clients/manager/ClientManagerService.cpp +++ b/dom/clients/manager/ClientManagerService.cpp @@ -601,6 +601,14 @@ public: nullptr); } + // But starting a process can failure for any number of reasons. Reject the + // promise if we could not. + if (!targetProcess) { + mPromise->Reject(NS_ERROR_ABORT, __func__); + mPromise = nullptr; + return NS_OK; + } + ClientOpenWindowOpParent* actor = new ClientOpenWindowOpParent(mArgs, mPromise); diff --git a/dom/ipc/ContentParent.cpp b/dom/ipc/ContentParent.cpp index 74d09b99814c..d717e549b5f8 100644 --- a/dom/ipc/ContentParent.cpp +++ b/dom/ipc/ContentParent.cpp @@ -1989,6 +1989,11 @@ ContentParent::LaunchSubprocess(ProcessPriority aInitialPriority /* = PROCESS_PR { AUTO_PROFILER_LABEL("ContentParent::LaunchSubprocess", OTHER); + if (!ContentProcessManager::GetSingleton()) { + // Shutdown has begun, we shouldn't spawn any more child processes. + return false; + } + std::vector extraArgs; extraArgs.push_back("-childID"); char idStr[21];