[xpcom] Timer cleanup, assertions and comments.

This commit is contained in:
Moonchild 2022-03-08 22:32:28 +00:00 committed by roytam1
commit bd80099e2c
4 changed files with 24 additions and 7 deletions

View file

@ -441,6 +441,8 @@ nsTimerImpl::Fire(int32_t aGeneration)
// Don't fire callbacks or fiddle with refcounts when the mutex is locked.
// If some other thread Cancels/Inits after this, they're just too late.
if (aGeneration != mGeneration) {
// This timer got rescheduled or cancelled before we fired, so ignore this
// firing
return;
}