mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-29 21:25:35 +00:00
timers can't be reused on all platforms, so just keep recreating it each time it fires
r=scottip a=leaf fix for #24874 (blocker)
This commit is contained in:
parent
eefbd4a4ea
commit
d570ac7a89
@ -264,18 +264,16 @@ nsMsgStatusFeedback::StartMeteors()
|
||||
{
|
||||
nsresult rv;
|
||||
|
||||
if (!mStartTimer) {
|
||||
rv = NS_NewTimer(getter_AddRefs(mStartTimer));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
}
|
||||
|
||||
// cancel outstanding starts
|
||||
if (mQueuedMeteorStarts>0) {
|
||||
mQueuedMeteorStarts--;
|
||||
NS_ASSERTION(mQueuedMeteorStarts == 0, "destroying unfired/uncanceled start timer");
|
||||
mStartTimer->Cancel();
|
||||
}
|
||||
|
||||
// if mStartTimer already exists, then this will cancel the old timer.
|
||||
rv = NS_NewTimer(getter_AddRefs(mStartTimer));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
rv = mStartTimer->Init(notifyStartMeteors, (void *)this,
|
||||
MSGFEEDBACK_TIMER_INTERVAL);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
@ -290,17 +288,15 @@ nsMsgStatusFeedback::StopMeteors()
|
||||
{
|
||||
nsresult rv;
|
||||
|
||||
if (!mStopTimer) {
|
||||
rv = NS_NewTimer(getter_AddRefs(mStopTimer));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
}
|
||||
|
||||
// cancel outstanding stops
|
||||
if (mQueuedMeteorStops>0) {
|
||||
mQueuedMeteorStops--;
|
||||
NS_ASSERTION(mQueuedMeteorStops == 0, "destroying unfired/uncanceled stop");
|
||||
mStopTimer->Cancel();
|
||||
}
|
||||
|
||||
// if mStopTimer already exists, then this will cancel the old timer.
|
||||
rv = NS_NewTimer(getter_AddRefs(mStopTimer));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
rv = mStopTimer->Init(notifyStopMeteors, (void *)this,
|
||||
MSGFEEDBACK_TIMER_INTERVAL);
|
||||
|
Loading…
Reference in New Issue
Block a user