diff --git a/dom/canvas/WebGLContextLossHandler.cpp b/dom/canvas/WebGLContextLossHandler.cpp index bf19b1ddd23..3cc1af03149 100644 --- a/dom/canvas/WebGLContextLossHandler.cpp +++ b/dom/canvas/WebGLContextLossHandler.cpp @@ -57,13 +57,12 @@ void WebGLContextLossHandler::TimerCallback() { MOZ_ASSERT(NS_GetCurrentThread() == mThread); + MOZ_ASSERT(mIsTimerRunning); + mIsTimerRunning = false; if (mIsDisabled) return; - MOZ_ASSERT(mIsTimerRunning); - mIsTimerRunning = false; - // If we need to run the timer again, restart it immediately. // Otherwise, the code we call into below might *also* try to // restart it. @@ -100,7 +99,7 @@ WebGLContextLossHandler::RunTimer() void WebGLContextLossHandler::DisableTimer() { - if (!mIsDisabled) + if (mIsDisabled) return; mIsDisabled = true;