Bug 840353 - Don't send OnStopRequest if we're cancelled. r=khuey a=lsblakk
authorJoe Drew <joe@drew.ca>
Wed, 13 Feb 2013 14:57:16 -0500
changeset 132364 6f33116954697c997c3c20f7b605e851a99cd86c
parent 132363 479c56b8ff80401746c8bb39c697e29d18e73933
child 132365 5caf33a81d94bc53eedd7f078a697b13911debbe
push id2323
push userbbajaj@mozilla.com
push dateMon, 01 Apr 2013 19:47:02 +0000
treeherdermozilla-beta@7712be144d91 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskhuey, lsblakk
bugs840353
milestone21.0a2
Bug 840353 - Don't send OnStopRequest if we're cancelled. r=khuey a=lsblakk
image/src/imgRequestProxy.cpp
--- a/image/src/imgRequestProxy.cpp
+++ b/image/src/imgRequestProxy.cpp
@@ -790,17 +790,17 @@ void imgRequestProxy::OnStopRequest(bool
   GetName(name);
   LOG_FUNC_WITH_PARAM(GetImgLog(), "imgRequestProxy::OnStopRequest", "name", name.get());
 #endif
   // There's all sorts of stuff here that could kill us (the OnStopRequest call
   // on the listener, the removal from the loadgroup, the release of the
   // listener, etc).  Don't let them do it.
   nsCOMPtr<imgIRequest> kungFuDeathGrip(this);
 
-  if (mListener) {
+  if (mListener && !mCanceled) {
     // Hold a ref to the listener while we call it, just in case.
     nsCOMPtr<imgINotificationObserver> kungFuDeathGrip(mListener);
     mListener->Notify(this, imgINotificationObserver::LOAD_COMPLETE, nullptr);
   }
 
   // If we're expecting more data from a multipart channel, re-add ourself
   // to the loadgroup so that the document doesn't lose track of the load.
   // If the request is already a background request and there's more data