Bug 1642817 - Avoid accessing sIndirectLayerTreesLock during shutdown. r=kats
authorBotond Ballo <botond@mozilla.com>
Wed, 03 Jun 2020 13:25:41 +0000
changeset 597796 124e127d05f467bed582507cc3e3db8d3100b7c7
parent 597795 57d02627fd056442e43862fca95d983f37783f78
child 597797 d2c50c8dbb5ddd3188ca4eb9b20d3b162250b72f
push id13310
push userffxbld-merge
push dateMon, 29 Jun 2020 14:50:06 +0000
treeherdermozilla-beta@15a59a0afa5c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskats
bugs1642817
milestone79.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 1642817 - Avoid accessing sIndirectLayerTreesLock during shutdown. r=kats Differential Revision: https://phabricator.services.mozilla.com/D77957
gfx/layers/ipc/CompositorBridgeParent.cpp
--- a/gfx/layers/ipc/CompositorBridgeParent.cpp
+++ b/gfx/layers/ipc/CompositorBridgeParent.cpp
@@ -2414,16 +2414,20 @@ CompositorBridgeParent::GetIndirectShado
   }
   return &cit->second;
 }
 
 /* static */
 bool CompositorBridgeParent::CallWithIndirectShadowTree(
     LayersId aId,
     const std::function<void(CompositorBridgeParent::LayerTreeState&)>& aFunc) {
+  if (!sIndirectLayerTreesLock) {
+    // Can hapen during shutdown
+    return false;
+  }
   // Note that this does not make things universally threadsafe just because the
   // sIndirectLayerTreesLock mutex is held. This is because the compositor
   // thread can mutate the LayerTreeState outside the lock. It does however
   // ensure that the *storage* for the LayerTreeState remains stable, since we
   // should always hold the lock when adding/removing entries to the map.
   MonitorAutoLock lock(*sIndirectLayerTreesLock);
   LayerTreeMap::iterator cit = sIndirectLayerTrees.find(aId);
   if (sIndirectLayerTrees.end() == cit) {