Bug 1336229 - Don't dispatch canceled IdleRequestExecutors. r=bkelly

IdleRequestExecutor::MaybeDispatch needs to handle the case when
mWindow is null, due to IdleRequestExecutor::Cancel setting mWindow to
nullptr.

MozReview-Commit-ID: F2Up5mItkqN
This commit is contained in:
Andreas Farre 2017-02-03 10:32:31 +01:00
parent 4562413d8c
commit a9d97e3d92

View File

@ -612,9 +612,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;
}