fixing tomorrow's blocker today (115527). r=ben sr=mscott

This commit is contained in:
pavlov@netscape.com
2001-12-17 06:59:55 +00:00
parent ebd7903cd7
commit d35d80e909
3 changed files with 21 additions and 8 deletions

View File

@@ -127,7 +127,7 @@ NS_IMETHODIMP TimerThread::Run()
mProcessing = PR_TRUE;
while (mProcessing) {
nsCOMPtr<nsTimerImpl> theTimer;
nsTimerImpl *theTimer = nsnull;
if (mTimers.Count() > 0) {
nsAutoLock lock(mLock);
@@ -141,6 +141,7 @@ NS_IMETHODIMP TimerThread::Run()
#endif
RemoveTimerInternal(timer);
theTimer = timer;
NS_ADDREF(theTimer);
}
}
@@ -151,7 +152,12 @@ NS_IMETHODIMP TimerThread::Run()
((now > theTimer->mTimeout) ? PR_IntervalToMilliseconds(now - theTimer->mTimeout) :
-(PRInt32)PR_IntervalToMilliseconds(theTimer->mTimeout - now))));
#endif
// We are going to let the call to Fire here handle the release of the timer so that
// we don't end up releasing the timer on the TimerThread
theTimer->Fire();
theTimer = nsnull;
}
nsAutoLock lock(mLock);