From 44959f50f86a3cdea96cc44baf7171eeed12a45e Mon Sep 17 00:00:00 2001 From: roytam1 Date: Wed, 15 Sep 2021 11:36:21 +0800 Subject: [PATCH] Bug 1724107, be more precise when counting the number of allocator users, r=KrisWright a=RyanVM --- xpcom/threads/TimerThread.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xpcom/threads/TimerThread.cpp b/xpcom/threads/TimerThread.cpp index d92c2ef90b..db7c924623 100644 --- a/xpcom/threads/TimerThread.cpp +++ b/xpcom/threads/TimerThread.cpp @@ -170,6 +170,7 @@ public: void operator delete(void* aPtr) { sAllocator->Free(aPtr); + sAllocatorUsers--; DeleteAllocatorIfNeeded(); } @@ -193,7 +194,6 @@ private: { MOZ_ASSERT(!sCanDeleteAllocator || sAllocatorUsers > 0, "This will result in us attempting to deallocate the nsTimerEvent allocator twice"); - sAllocatorUsers--; } RefPtr mTimer;