Bug 1797688 - Part 4: Bail out from IDecodingTask::NotifyProgress and NotifyDecodeComplete InOrBeyond(XPCOMShutdownThreads). r=xpcom-reviewers,mccr8

Differential Revision: https://phabricator.services.mozilla.com/D160622
This commit is contained in:
Jens Stutte
2022-11-01 14:08:44 +00:00
parent 237f5e836a
commit edb9c1b473

View File

@@ -6,6 +6,7 @@
#include "IDecodingTask.h"
#include "nsThreadUtils.h"
#include "mozilla/AppShutdown.h"
#include "Decoder.h"
#include "DecodePool.h"
@@ -78,7 +79,8 @@ void IDecodingTask::NotifyProgress(NotNull<RasterImage*> aImage,
}
// Don't try to dispatch after shutdown, we'll just leak the runnable.
if (gXPCOMThreadsShutDown) {
if (NS_WARN_IF(
AppShutdown::IsInOrBeyond(ShutdownPhase::XPCOMShutdownThreads))) {
return;
}
@@ -119,7 +121,8 @@ void IDecodingTask::NotifyDecodeComplete(NotNull<RasterImage*> aImage,
}
// Don't try to dispatch after shutdown, we'll just leak the runnable.
if (gXPCOMThreadsShutDown) {
if (NS_WARN_IF(
AppShutdown::IsInOrBeyond(ShutdownPhase::XPCOMShutdownThreads))) {
return;
}