Bug 844403 - Make VectorImage cancel all listeners when destroyed. r=dholbert
authorSeth Fowler <seth@mozilla.com>
Mon, 25 Feb 2013 17:40:13 -0800
changeset 122889 73f0c5b00572732a78ed10bb26b89d56ab6aaefe
parent 122888 06935f2db2679c12ba434c01ddf1d0bab62439c2
child 122953 f9ece777368eedfcb0bdfa0a5680e968def8a319
push id24362
push usermfowler@mozilla.com
push dateTue, 26 Feb 2013 01:44:22 +0000
treeherdermozilla-central@73f0c5b00572 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdholbert
bugs844403
milestone22.0a1
first release with
nightly linux32
73f0c5b00572 / 22.0a1 / 20130226031002 / files
nightly linux64
73f0c5b00572 / 22.0a1 / 20130226031002 / files
nightly mac
73f0c5b00572 / 22.0a1 / 20130226031002 / files
nightly win32
73f0c5b00572 / 22.0a1 / 20130226031002 / files
nightly win64
73f0c5b00572 / 22.0a1 / 20130226031002 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 844403 - Make VectorImage cancel all listeners when destroyed. r=dholbert
image/src/VectorImage.cpp
--- a/image/src/VectorImage.cpp
+++ b/image/src/VectorImage.cpp
@@ -297,16 +297,17 @@ VectorImage::VectorImage(imgStatusTracke
   mIsDrawing(false),
   mHaveAnimations(false),
   mHaveRestrictedRegion(false)
 {
 }
 
 VectorImage::~VectorImage()
 {
+  CancelAllListeners();
 }
 
 //------------------------------------------------------------------------------
 // Methods inherited from Image.h
 
 nsresult
 VectorImage::Init(const char* aMimeType,
                   uint32_t aFlags)
@@ -894,19 +895,16 @@ VectorImage::OnSVGDocumentParsed()
     // notified that the SVG finished loading, so we need to treat this as an error.
     OnSVGDocumentError();
   }
 }
 
 void
 VectorImage::CancelAllListeners()
 {
-  NS_ABORT_IF_FALSE(mParseCompleteListener, "Should have the parse complete listener");
-  NS_ABORT_IF_FALSE(mLoadEventListener, "Should have the load event listener");
-
   if (mParseCompleteListener) {
     mParseCompleteListener->Cancel();
     mParseCompleteListener = nullptr;
   }
   if (mLoadEventListener) {
     mLoadEventListener->Cancel();
     mLoadEventListener = nullptr;
   }