diff options
author | Randell Jesup <rjesup@wgate.com> | 2022-02-10 11:03:26 +0000 |
---|---|---|
committer | Moonchild <moonchild@palemoon.org> | 2022-05-30 08:25:59 +0000 |
commit | ac6d297268f39c4380a1eb1a38a5278605752c6a (patch) | |
tree | cbcc207e75dc7b9ddc92be5a6e1cc978a3141287 /image | |
parent | ea3642103fe40fbecac971d8fa89795f61a513a8 (diff) | |
download | uxp-ac6d297268f39c4380a1eb1a38a5278605752c6a.tar.gz |
[Image] Image cleanup
Diffstat (limited to 'image')
-rw-r--r-- | image/imgRequest.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/image/imgRequest.cpp b/image/imgRequest.cpp index ba99779d30..2a8af98cf4 100644 --- a/image/imgRequest.cpp +++ b/image/imgRequest.cpp @@ -96,6 +96,8 @@ imgRequest::Init(nsIURI *aURI, ReferrerPolicy aReferrerPolicy) { MOZ_ASSERT(NS_IsMainThread(), "Cannot use nsIURI off main thread!"); + // Init() can only be called once, and that's before it can be used off + // mainthread LOG_FUNC(gImgLog, "imgRequest::Init"); @@ -800,7 +802,14 @@ imgRequest::OnStopRequest(nsIRequest* aRequest, RefPtr<imgRequest> strongThis = this; - if (mIsMultiPartChannel && mNewPartPending) { + bool isMultipart = false; + bool newPartPending = false; + { + MutexAutoLock lock(mMutex); + isMultipart = mIsMultiPartChannel; + newPartPending = mNewPartPending; + } + if (isMultipart && newPartPending) { OnDataAvailable(aRequest, ctxt, nullptr, 0, 0); } |