Bug 1882181 - In gfxUserFontEntry::ContinueLoad, check whether the load has been cancelled already. r=gfx-reviewers,lsalzman

This can happen if there's been a font-list rebuild (which cancels any pending loads)
in between posting the ContinueLoad runnable and the main thread getting a chance to
run it.

Differential Revision: https://phabricator.services.mozilla.com/D206229
This commit is contained in:
Jonathan Kew 2024-04-01 16:03:43 +00:00
parent 2ef639d204
commit ec6595c2d7

View file

@ -393,6 +393,12 @@ void gfxUserFontEntry::LoadNextSrc() {
}
void gfxUserFontEntry::ContinueLoad() {
if (mUserFontLoadState == STATUS_NOT_LOADED) {
// We must have been cancelled (possibly due to a font-list refresh) while
// the runnable was pending, so just bail out.
return;
}
MOZ_ASSERT(mUserFontLoadState == STATUS_LOAD_PENDING);
MOZ_ASSERT(mSrcList[mCurrentSrcIndex].mSourceType ==
gfxFontFaceSrc::eSourceType_URL);