Fix assert deallocating shmems on GPU process restart. (bug 1311715, r=mattwoodrow)
authorDavid Anderson <danderson@mozilla.com>
Mon, 24 Oct 2016 01:05:23 -0700
changeset 319156 cd05381f28b151f9b8afb11af3f6b9366677d598
parent 319155 918cb92107ecc8e0bf7c8c26b8649028cb19d90d
child 319157 4f7f541d40ec6064018b95f0f5afe9189bffcb8d
push id30862
push usercbook@mozilla.com
push dateMon, 24 Oct 2016 14:55:55 +0000
treeherdermozilla-central@c845bfd0accb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow
bugs1311715
milestone52.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
Fix assert deallocating shmems on GPU process restart. (bug 1311715, r=mattwoodrow)
gfx/layers/ipc/CompositorBridgeChild.cpp
--- a/gfx/layers/ipc/CompositorBridgeChild.cpp
+++ b/gfx/layers/ipc/CompositorBridgeChild.cpp
@@ -1054,17 +1054,20 @@ CompositorBridgeChild::AllocShmem(size_t
 {
   ShmemAllocated(this);
   return PCompositorBridgeChild::AllocShmem(aSize, aType, aShmem);
 }
 
 void
 CompositorBridgeChild::DeallocShmem(ipc::Shmem& aShmem)
 {
-    PCompositorBridgeChild::DeallocShmem(aShmem);
+  if (!mCanSend) {
+    return;
+  }
+  PCompositorBridgeChild::DeallocShmem(aShmem);
 }
 
 widget::PCompositorWidgetChild*
 CompositorBridgeChild::AllocPCompositorWidgetChild(const CompositorWidgetInitData& aInitData)
 {
   // We send the constructor manually.
   MOZ_CRASH("Should not be called");
   return nullptr;