From 45e7e3ac910a2497e6f755315ee8e6fcbd9d9e40 Mon Sep 17 00:00:00 2001 From: Benoit Jacob Date: Wed, 11 Dec 2013 13:05:23 -0500 Subject: [PATCH] Bug 897452 - Part 8 - fix TextureParent::ActorDestroy - r=nical --- gfx/layers/composite/TextureHost.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/gfx/layers/composite/TextureHost.cpp b/gfx/layers/composite/TextureHost.cpp index c7f7f187dab..6d0bca20152 100644 --- a/gfx/layers/composite/TextureHost.cpp +++ b/gfx/layers/composite/TextureHost.cpp @@ -675,21 +675,23 @@ TextureParent::RecvRemoveTextureSync() void TextureParent::ActorDestroy(ActorDestroyReason why) { + if (!mTextureHost) { + return; + } + switch (why) { case AncestorDeletion: NS_WARNING("PTexture deleted after ancestor"); // fall-through to deletion path case Deletion: - if (mTextureHost && mTextureHost->GetFlags() & !TEXTURE_DEALLOCATE_CLIENT) { + if (!(mTextureHost->GetFlags() & TEXTURE_DEALLOCATE_CLIENT)) { mTextureHost->DeallocateSharedData(); } break; case NormalShutdown: case AbnormalShutdown: - if (mTextureHost) { - mTextureHost->OnActorDestroy(); - } + mTextureHost->OnActorDestroy(); break; case FailedConstructor: