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