Bug 1545980 - Add IPCOpen() check to WebRenderLayerManager::ClearCachedResources() r=nical
authorsotaro <sotaro.ikeda.g@gmail.com>
Tue, 23 Apr 2019 12:16:27 +0000
changeset 470478 f987a04773cf19f1f8acf0d87c36dc45e44f586c
parent 470477 1fb8d0d598d0c4c681320bb0ee0dfafecb3caad9
child 470479 faab5ee080b68acb0eff49bf0a9f3db10ad44a8d
push id35906
push useraciure@mozilla.com
push dateTue, 23 Apr 2019 22:14:56 +0000
treeherdermozilla-central@0ce3633f8b80 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnical
bugs1545980
milestone68.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 1545980 - Add IPCOpen() check to WebRenderLayerManager::ClearCachedResources() r=nical Differential Revision: https://phabricator.services.mozilla.com/D28317
gfx/layers/wr/WebRenderLayerManager.cpp
--- a/gfx/layers/wr/WebRenderLayerManager.cpp
+++ b/gfx/layers/wr/WebRenderLayerManager.cpp
@@ -578,16 +578,20 @@ void WebRenderLayerManager::DidComposite
 
   // These observers fire whether or not we were in a transaction.
   for (size_t i = 0; i < mDidCompositeObservers.Length(); i++) {
     mDidCompositeObservers[i]->DidComposite();
   }
 }
 
 void WebRenderLayerManager::ClearCachedResources(Layer* aSubtree) {
+  if (!WrBridge()->IPCOpen()) {
+    gfxCriticalNote << "IPC Channel is already torn down unexpectedly\n";
+    return;
+  }
   WrBridge()->BeginClearCachedResources();
   mWebRenderCommandBuilder.ClearCachedResources();
   DiscardImages();
   for (auto& stateManager : mStateManagers) {
     stateManager.ClearCachedResources();
   }
   WrBridge()->EndClearCachedResources();
 }