Bug 1187386 (Part 3) - Don't destroy Decoder::mImage if Decoder::mImage is null. r=tn
authorSeth Fowler <mark.seth.fowler@gmail.com>
Fri, 31 Jul 2015 07:29:07 -0700
changeset 287399 6d193bf1559a8d331c5a007cfe4b8b8c5531c33f
parent 287398 bf702d0ae9c8d9a830a86b212ef8a40664b3226e
child 287400 31e7e0fab77b926e7d6e2c55f598e5d353de7dfd
push id5067
push userraliiev@mozilla.com
push dateMon, 21 Sep 2015 14:04:52 +0000
treeherdermozilla-beta@14221ffe5b2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstn
bugs1187386
milestone42.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1187386 (Part 3) - Don't destroy Decoder::mImage if Decoder::mImage is null. r=tn
image/Decoder.cpp
--- a/image/Decoder.cpp
+++ b/image/Decoder.cpp
@@ -52,17 +52,17 @@ Decoder::Decoder(RasterImage* aImage)
 Decoder::~Decoder()
 {
   MOZ_ASSERT(mProgress == NoProgress,
              "Destroying Decoder without taking all its progress changes");
   MOZ_ASSERT(mInvalidRect.IsEmpty(),
              "Destroying Decoder without taking all its invalidations");
   mInitialized = false;
 
-  if (!NS_IsMainThread()) {
+  if (mImage && !NS_IsMainThread()) {
     // Dispatch mImage to main thread to prevent it from being destructed by the
     // decode thread.
     nsCOMPtr<nsIThread> mainThread = do_GetMainThread();
     NS_WARN_IF_FALSE(mainThread, "Couldn't get the main thread!");
     if (mainThread) {
       // Handle ambiguous nsISupports inheritance.
       RasterImage* rawImg = nullptr;
       mImage.swap(rawImg);