From 0a428b1a4138af7d5fd4a51ffd05d5e278a4f7fc Mon Sep 17 00:00:00 2001 From: peter chang Date: Wed, 2 Mar 2016 09:31:44 +0800 Subject: [PATCH] Bug 1250418 - Remove the assertion check of mCanSend in CompositorChild::ActorDestroy, r=nical MozReview-Commit-ID: L0VSy4cYglh --HG-- extra : rebase_source : 28a1e3501b74a6883c5ed5855231757fee4d1415 --- gfx/layers/ipc/CompositorChild.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/gfx/layers/ipc/CompositorChild.cpp b/gfx/layers/ipc/CompositorChild.cpp index 1e102102f639..d11ca478bb8c 100644 --- a/gfx/layers/ipc/CompositorChild.cpp +++ b/gfx/layers/ipc/CompositorChild.cpp @@ -415,19 +415,23 @@ CompositorChild::RecvClearCachedResources(const uint64_t& aId) void CompositorChild::ActorDestroy(ActorDestroyReason aWhy) { - MOZ_ASSERT(!mCanSend); MOZ_ASSERT(sCompositor == this); + if (aWhy == AbnormalShutdown) { #ifdef MOZ_B2G // Due to poor lifetime management of gralloc (and possibly shmems) we will // crash at some point in the future when we get destroyed due to abnormal // shutdown. Its better just to crash here. On desktop though, we have a chance // of recovering. - if (aWhy == AbnormalShutdown) { NS_RUNTIMEABORT("ActorDestroy by IPC channel failure at CompositorChild"); - } #endif + // If the parent side runs into a problem then the actor will be destroyed. + // There is nothing we can do in the child side, here sets mCanSend as false. + mCanSend = false; + gfxCriticalNote << "Receive IPC close with reason=" << aWhy; + } + MessageLoop::current()->PostTask( FROM_HERE, NewRunnableMethod(this, &CompositorChild::Release));