From dadd11df422db95e7ecfe57929dc28dfa524d5b1 Mon Sep 17 00:00:00 2001 From: janekptacijarabaci Date: Wed, 18 Apr 2018 15:17:55 +0200 Subject: Bug 1336229 - Don't dispatch canceled IdleRequestExecutors --- dom/base/nsGlobalWindow.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'dom') diff --git a/dom/base/nsGlobalWindow.cpp b/dom/base/nsGlobalWindow.cpp index 6a49f440f..b8cb1facb 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; } -- cgit v1.2.3