Bug 803125 - Notify status tracker when image request is destroyed. r=joe

This commit is contained in:
Josh Matthews 2012-11-17 13:33:20 +00:00
parent aa68b3314a
commit 440d2df25e
3 changed files with 12 additions and 0 deletions

View File

@ -108,6 +108,9 @@ imgRequest::imgRequest(imgLoader* aLoader)
imgRequest::~imgRequest()
{
// The status tracker can outlive this request, and needs to know it's dying.
GetStatusTracker().ClearRequest();
if (mURI) {
nsAutoCString spec;
mURI->GetSpec(spec);

View File

@ -766,3 +766,9 @@ imgStatusTracker::MaybeUnblockOnload()
SendUnblockOnload(iter.GetNext());
}
}
void
imgStatusTracker::ClearRequest()
{
mRequest = nullptr;
}

View File

@ -186,6 +186,9 @@ public:
void MaybeUnblockOnload();
// Null out any reference to an associated image request
void ClearRequest();
// Weak pointer getters - no AddRefs.
inline mozilla::image::Image* GetImage() const { return mImage; };
inline imgRequest* GetRequest() const { return mRequest; };