From f21fb24f3fd483c8f759d7ce4f0b820c3b7c513c Mon Sep 17 00:00:00 2001 From: Simon Giesecke Date: Tue, 8 Dec 2020 13:00:12 +0000 Subject: [PATCH] Bug 1666214 - Don't crash if the shutdown already completed when the shutdown timeout event is processed. r=dom-workers-and-storage-reviewers,janv Differential Revision: https://phabricator.services.mozilla.com/D99066 --- dom/quota/Client.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/dom/quota/Client.cpp b/dom/quota/Client.cpp index d38a40764e6d..0fca249c4c31 100644 --- a/dom/quota/Client.cpp +++ b/dom/quota/Client.cpp @@ -304,7 +304,13 @@ bool Client::InitiateShutdownWorkThreads() { [](nsITimer* aTimer, void* aClosure) { auto* const quotaClient = static_cast(aClosure); - MOZ_DIAGNOSTIC_ASSERT(!quotaClient->IsShutdownCompleted()); + if (quotaClient->IsShutdownCompleted()) { + // Apparently, the shutdown did complete between the timer + // fired and we processed the event. So there's no reason to + // crash, just do nothing. + + return; + } const auto type = TypeToText(quotaClient->GetType());