From 4525952bde6bae20b8694aae184bdbd38eafe031 Mon Sep 17 00:00:00 2001 From: Botond Ballo Date: Thu, 31 Oct 2019 01:02:08 +0000 Subject: [PATCH] Bug 1592435 - Avoid a shutdown-crash during gtests. r=tnikkel This is unrelated to this bug, I just ran into it while running the tests. Differential Revision: https://phabricator.services.mozilla.com/D51201 --HG-- extra : moz-landing-system : lando --- gfx/layers/apz/src/APZCTreeManager.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/gfx/layers/apz/src/APZCTreeManager.cpp b/gfx/layers/apz/src/APZCTreeManager.cpp index ecb4cab53f49..96360974c1a8 100644 --- a/gfx/layers/apz/src/APZCTreeManager.cpp +++ b/gfx/layers/apz/src/APZCTreeManager.cpp @@ -21,10 +21,10 @@ #include "mozilla/dom/Touch.h" // for Touch #include "mozilla/gfx/CompositorHitTestInfo.h" #include "mozilla/gfx/LoggingConstants.h" -#include "mozilla/gfx/gfxVars.h" // for gfxVars -#include "mozilla/gfx/GPUParent.h" // for GPUParent -#include "mozilla/gfx/Logging.h" // for gfx::TreeLog -#include "mozilla/gfx/Point.h" // for Point +#include "mozilla/gfx/gfxVars.h" // for gfxVars +#include "mozilla/gfx/GPUParent.h" // for GPUParent +#include "mozilla/gfx/Logging.h" // for gfx::TreeLog +#include "mozilla/gfx/Point.h" // for Point #include "mozilla/layers/APZSampler.h" // for APZSampler #include "mozilla/layers/APZThreadUtils.h" // for AssertOnControllerThread, etc #include "mozilla/layers/APZUpdater.h" // for APZUpdater @@ -3372,6 +3372,10 @@ bool APZCTreeManager::GetAPZTestData(LayersId aLayersId, void APZCTreeManager::SendSubtreeTransformsToChromeMainThread( const AsyncPanZoomController* aAncestor) { + if (!mRootNode) { + // Event dispatched during shutdown, after ClearTree(). + return; + } RefPtr controller = GetContentController(mRootLayersId); if (!controller) {