Bug 877638 - Crash in WakeLockBoolWrapper::UpdateWakeLock when running crashtests. r=ehsan

This commit is contained in:
Andrea Marchesini 2013-05-30 11:26:12 -04:00
parent 153c7c8f28
commit 571b536df0

View File

@ -2153,8 +2153,10 @@ HTMLMediaElement::WakeLockBoolWrapper::UpdateWakeLock()
// grace period.
int timeout = Preferences::GetInt("media.wakelock_timeout", 2000);
mTimer = do_CreateInstance("@mozilla.org/timer;1");
mTimer->InitWithFuncCallback(TimerCallback, this, timeout,
nsITimer::TYPE_ONE_SHOT);
if (mTimer) {
mTimer->InitWithFuncCallback(TimerCallback, this, timeout,
nsITimer::TYPE_ONE_SHOT);
}
}
}