diff --git a/dom/base/nsJSEnvironment.cpp b/dom/base/nsJSEnvironment.cpp index 4ecdbb1fad80..fbd1f7cb680d 100644 --- a/dom/base/nsJSEnvironment.cpp +++ b/dom/base/nsJSEnvironment.cpp @@ -2504,6 +2504,13 @@ nsJSContext::PokeGC(JS::gcreason::Reason aReason, int aDelay) return; } + if (sICCTimer) { + // Make sure GC is called after the current CC completes. + // No need to set sNeedsFullCC because we are currently running a CC. + sNeedsGCAfterCC = true; + return; + } + CallCreateInstance("@mozilla.org/timer;1", &sGCTimer); if (!sGCTimer) {