From 7fd0085393a899b838a4ed8c890624f3ba077e38 Mon Sep 17 00:00:00 2001 From: janekptacijarabaci Date: Wed, 18 Apr 2018 15:17:55 +0200 Subject: [PATCH] Bug 1336229 - Don't dispatch canceled IdleRequestExecutors --- dom/base/nsGlobalWindow.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/dom/base/nsGlobalWindow.cpp b/dom/base/nsGlobalWindow.cpp index 6a49f440ff..b8cb1facbd 100644 --- a/dom/base/nsGlobalWindow.cpp +++ b/dom/base/nsGlobalWindow.cpp @@ -640,9 +640,11 @@ IdleRequestExecutor::SetDeadline(TimeStamp aDeadline) void IdleRequestExecutor::MaybeDispatch() { - MOZ_DIAGNOSTIC_ASSERT(mWindow); - - if (mDispatched) { + // If we've already dispatched the executor we don't want to do it + // again. Also, if we've called IdleRequestExecutor::Cancel mWindow + // will be null, which indicates that we shouldn't dispatch this + // executor either. + if (mDispatched || !mWindow) { return; }