commit e382faaaecea798286ac5bd1c883b8e4bfb1152d
parent 699d21d560e2b89179c30d9e58d925e3f783cb63
Author: Matthew Gaudet <mgaudet@mozilla.com>
Date: Tue, 28 Oct 2025 19:32:51 +0000
Bug 1996122 - Drop Suppression job microtask ref count r=smaug
Becasue we add a ref when we add the SuppressedMicroTaskList to the queue
when it comes off the list, -even if we do nothing with it- we need to make
sure that we drop the ref count, else we get a leak of a PersistentRooted.
Differential Revision: https://phabricator.services.mozilla.com/D269917
Diffstat:
1 file changed, 5 insertions(+), 0 deletions(-)
diff --git a/xpcom/base/CycleCollectedJSContext.cpp b/xpcom/base/CycleCollectedJSContext.cpp
@@ -1207,6 +1207,11 @@ bool CycleCollectedJSContext::PerformMicroTaskCheckPoint(bool aForce) {
mSuppressedMicroTaskList->mSuppressedMicroTaskRunnables.get().append(
std::move(job.get()));
+ } else {
+ // Consume the runnable & simultaneously drop a ref count.
+ RefPtr<MicroTaskRunnable> refToDrop(
+ MaybeUnwrapTaskToOwnedRunnable(&job));
+ MOZ_ASSERT(refToDrop);
}
} else {
// MG:XXX: It's sort of too bad that we can't handle the JobQueueIsEmpty