commit 00b68125d6793183e71d3960a96536a70e036fa3
parent 77092b1d35aa0aa003f995b6a13343d6c269dea3
Author: Florian Quèze <florian@queze.net>
Date: Wed, 1 Oct 2025 12:51:18 +0000
Bug 1991876 - clear uncaught rejection observers during shutdown, r=smaug.
Differential Revision: https://phabricator.services.mozilla.com/D266980
Diffstat:
2 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/xpcom/base/CycleCollectedJSContext.h b/xpcom/base/CycleCollectedJSContext.h
@@ -163,6 +163,10 @@ class CycleCollectedJSContext : dom::PerThreadAtomCache, private JS::JobQueue {
public:
void ProcessStableStateQueue();
+ void ClearUncaughtRejectionObservers() {
+ mUncaughtRejectionObservers.Clear();
+ }
+
private:
void CleanupIDBTransactions(uint32_t aRecursionDepth);
diff --git a/xpcom/base/nsCycleCollector.cpp b/xpcom/base/nsCycleCollector.cpp
@@ -3611,6 +3611,7 @@ void nsCycleCollector::ShutdownCollect() {
// clear them out before we run the CC again or finish shutting down.
ccJSContext->PerformMicroTaskCheckPoint(true);
ccJSContext->ProcessStableStateQueue();
+ ccJSContext->ClearUncaughtRejectionObservers();
}
// This warning would happen very frequently, so don't do it unless we're