summaryrefslogtreecommitdiff
path: root/image
diff options
context:
space:
mode:
authorRandell Jesup <rjesup@wgate.com>2022-02-10 11:03:26 +0000
committerMoonchild <moonchild@palemoon.org>2022-05-30 08:25:59 +0000
commitac6d297268f39c4380a1eb1a38a5278605752c6a (patch)
treecbcc207e75dc7b9ddc92be5a6e1cc978a3141287 /image
parentea3642103fe40fbecac971d8fa89795f61a513a8 (diff)
downloaduxp-ac6d297268f39c4380a1eb1a38a5278605752c6a.tar.gz
[Image] Image cleanup
Diffstat (limited to 'image')
-rw-r--r--image/imgRequest.cpp11
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);
}