summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-04-18 15:17:55 +0200
committerjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-04-18 15:17:55 +0200
commitdadd11df422db95e7ecfe57929dc28dfa524d5b1 (patch)
tree9dd9bdbe8e0ae305150f68d92b72592506abed4f
parentc559e3e30f79843f0096332334c81ee0d93029f8 (diff)
downloaduxp-dadd11df422db95e7ecfe57929dc28dfa524d5b1.tar.gz
Bug 1336229 - Don't dispatch canceled IdleRequestExecutors
-rw-r--r--dom/base/nsGlobalWindow.cpp8
1 files 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;
}