Bug 804041 - Remove the image from the discard tracker at a more appropriate time. r=joe a=lsblakk
authorJustin Lebar <justin.lebar@gmail.com>
Fri, 26 Oct 2012 14:56:46 -0400
changeset 109688 8bd5b4da0d06303aac15d8d23543dc34e1d22ac1
parent 109687 8fb3c3ea5e07a13e873f5cd0b8ff8481eb6c1e90
child 109689 a2cc1ba868179ec39e91b1ce4035437e6f2add66
push id1614
push userjdrew@mozilla.com
push dateFri, 26 Oct 2012 18:56:46 +0000
treeherdermozilla-beta@8bd5b4da0d06 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjoe, lsblakk
bugs804041
milestone17.0
Bug 804041 - Remove the image from the discard tracker at a more appropriate time. r=joe a=lsblakk
image/src/RasterImage.cpp
--- a/image/src/RasterImage.cpp
+++ b/image/src/RasterImage.cpp
@@ -203,29 +203,32 @@ RasterImage::~RasterImage()
             ("CompressedImageAccounting: destroying RasterImage %p.  "
              "Total Containers: %d, Discardable containers: %d, "
              "Total source bytes: %lld, Source bytes for discardable containers %lld",
              this,
              num_containers,
              num_discardable_containers,
              total_source_bytes,
              discardable_source_bytes));
-    DiscardTracker::Remove(&mDiscardTrackerNode);
   }
 
   // If we have a decoder open, shut it down
   if (mDecoder) {
     nsresult rv = ShutdownDecoder(eShutdownIntent_Interrupted);
     if (NS_FAILED(rv))
       NS_WARNING("Failed to shut down decoder in destructor!");
   }
 
   // Total statistics
   num_containers--;
   total_source_bytes -= mSourceData.Length();
+
+  if (DiscardingActive()) {
+    DiscardTracker::Remove(&mDiscardTrackerNode);
+  }
 }
 
 nsresult
 RasterImage::Init(imgIDecoderObserver *aObserver,
                   const char* aMimeType,
                   const char* aURIString,
                   uint32_t aFlags)
 {