Bug 853774 - RequestBehaviour must handle null owners. r=joe
authorSeth Fowler <seth@mozilla.com>
Thu, 25 Apr 2013 20:30:29 -0700
changeset 130024 648b0cd188834babb7d77b8377a1b6f1b3fbb96b
parent 130023 8b9d1e3ae677bb074e936f7a9fbf96c5663d15ec
child 130025 5f5bbd697d25612b2505009778aab60951654514
push id1552
push userttaubert@mozilla.com
push dateSat, 27 Apr 2013 15:33:29 +0000
treeherderfx-team@40dafc376794 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjoe
bugs853774
milestone23.0a1
Bug 853774 - RequestBehaviour must handle null owners. r=joe
image/src/imgRequestProxy.cpp
--- a/image/src/imgRequestProxy.cpp
+++ b/image/src/imgRequestProxy.cpp
@@ -50,17 +50,22 @@ class RequestBehaviour : public ProxyBeh
   virtual imgStatusTracker& GetStatusTracker() const MOZ_OVERRIDE;
 
   virtual imgRequest* GetOwner() const MOZ_OVERRIDE {
     return mOwner;
   }
 
   virtual void SetOwner(imgRequest* aOwner) MOZ_OVERRIDE {
     mOwner = aOwner;
-    mOwnerHasImage = !!aOwner->GetStatusTracker().GetImage();
+
+    if (mOwner) {
+      mOwnerHasImage = !!aOwner->GetStatusTracker().GetImage();
+    } else {
+      mOwnerHasImage = false;
+    }
   }
 
  private:
   // We maintain the following invariant:
   // The proxy is registered at most with a single imgRequest as an observer,
   // and whenever it is, mOwner points to that object. This helps ensure that
   // imgRequestProxy::~imgRequestProxy unregisters the proxy as an observer
   // from whatever request it was registered with (if any). This, in turn,