From 600142110df81dcce3c02c25995b3afb4418b180 Mon Sep 17 00:00:00 2001 From: Kershaw Chang Date: Wed, 20 Dec 2023 21:52:13 +0100 Subject: [PATCH] Bug 1736385 - Make sure thread is alive in CacheIOThread::ThreadFunc --- netwerk/cache2/CacheIOThread.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netwerk/cache2/CacheIOThread.cpp b/netwerk/cache2/CacheIOThread.cpp index fe0a4ddb05..61fd6677c3 100644 --- a/netwerk/cache2/CacheIOThread.cpp +++ b/netwerk/cache2/CacheIOThread.cpp @@ -417,6 +417,7 @@ void CacheIOThread::ThreadFunc() threadInternal->SetObserver(this); mXPCOMThread = xpcomThread.forget().take(); + nsCOMPtr thread = NS_GetCurrentThread(); lock.NotifyAll(); @@ -437,7 +438,6 @@ loopStart: bool processedEvent; nsresult rv; do { - nsIThread *thread = mXPCOMThread; rv = thread->ProcessNextEvent(false, &processedEvent); MOZ_ASSERT(mBlockingIOWatcher);