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:
alecf%netscape.com 2000-01-24 18:52:42 +00:00
parent eefbd4a4ea
commit d570ac7a89

View File

@ -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);