Bug 1724107, be more precise when counting the number of allocator users, r=KrisWright

The patch is based on code inspection.

One could move sAllocatorUsers also to Free(), but shouldn't matter in practise.

Differential Revision: https://phabricator.services.mozilla.com/D121868
This commit is contained in:
Olli Pettay 2021-08-05 19:36:32 +00:00
parent 74a8d8dd6b
commit 42e939719a

View File

@ -149,6 +149,7 @@ class nsTimerEvent final : public CancelableRunnable {
}
void operator delete(void* aPtr) {
sAllocator->Free(aPtr);
sAllocatorUsers--;
DeleteAllocatorIfNeeded();
}
@ -163,7 +164,6 @@ class nsTimerEvent final : public CancelableRunnable {
MOZ_ASSERT(!sCanDeleteAllocator || sAllocatorUsers > 0,
"This will result in us attempting to deallocate the "
"nsTimerEvent allocator twice");
sAllocatorUsers--;
}
TimeStamp mInitTime;