b=821230; crash in nsRefreshDriver::SetHighPrecisionTimersEnabled during xpcom shutdown; r=ehsan

This commit is contained in:
Vladimir Vukicevic 2012-12-14 12:47:57 -05:00
Родитель 02ada69f1b
Коммит 780aec2bb7
1 изменённых файлов: 11 добавлений и 5 удалений

Просмотреть файл

@ -711,11 +711,17 @@ nsRefreshDriver::SetHighPrecisionTimersEnabled(bool aEnable)
NS_ASSERTION(!sDisableHighPrecisionTimersTimer, "We shouldn't have an outstanding disable-high-precision timer !");
nsCOMPtr<nsITimer> timer = do_CreateInstance(NS_TIMER_CONTRACTID);
timer.forget(&sDisableHighPrecisionTimersTimer);
sDisableHighPrecisionTimersTimer->InitWithFuncCallback(DisableHighPrecisionTimersCallback,
nullptr,
90 * 1000,
nsITimer::TYPE_ONE_SHOT);
if (timer) {
timer.forget(&sDisableHighPrecisionTimersTimer);
sDisableHighPrecisionTimersTimer->InitWithFuncCallback(DisableHighPrecisionTimersCallback,
nullptr,
90 * 1000,
nsITimer::TYPE_ONE_SHOT);
} else {
// might happen if we're shutting down XPCOM; just drop the time period down
// immediately
timeEndPeriod(1);
}
}
#endif
mRequestedHighPrecision = false;