Bug 801405 - Avoid attempting to optimize frames that no longer exist. r=joe
authorJosh Matthews <josh@joshmatthews.net>
Mon, 15 Oct 2012 18:06:43 -0400
changeset 110474 eb9d81f99cd742dc9bc19f6f4949f781474bc844
parent 110473 c118efe23e9e02292ed233c717ae3ebdab6fa427
child 110475 e54a4777f65a41a9dac22a3091a6b90bba3aa1d2
push id93
push usernmatsakis@mozilla.com
push dateWed, 31 Oct 2012 21:26:57 +0000
reviewersjoe
bugs801405
milestone19.0a1
Bug 801405 - Avoid attempting to optimize frames that no longer exist. r=joe
image/src/RasterImage.cpp
--- a/image/src/RasterImage.cpp
+++ b/image/src/RasterImage.cpp
@@ -251,16 +251,17 @@ RasterImage::RasterImage(imgStatusTracke
 RasterImage::~RasterImage()
 {
   ScaleRequest::Stop(mScaleRequest.image);
 
   delete mAnim;
 
   for (unsigned int i = 0; i < mFrames.Length(); ++i)
     delete mFrames[i];
+  mFrames.Clear();
 
   // Discardable statistics
   if (mDiscardable) {
     num_discardable_containers--;
     discardable_source_bytes -= mSourceData.Length();
 
     PR_LOG (gCompressedImageAccountingLog, PR_LOG_DEBUG,
             ("CompressedImageAccounting: destroying RasterImage %p.  "