diff options
author | Randell Jesup <rjesup@wgate.com> | 2022-02-10 11:03:26 +0000 |
---|---|---|
committer | Moonchild <moonchild@palemoon.org> | 2022-04-03 01:13:05 +0200 |
commit | 0a84c9b4e4719d775a573e73e2fb2128dee8ee56 (patch) | |
tree | 27578a23a2f24c4342c9f3a65d42f749c59eb4da | |
parent | 400467171c8eaf3fdbe8dbe46d1e06f444a82ec9 (diff) | |
download | uxp-0a84c9b4e4719d775a573e73e2fb2128dee8ee56.tar.gz |
[Image] Image cleanup
-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); } |