From a400cea0404dc5b936799031ee23e1d1271528e7 Mon Sep 17 00:00:00 2001 From: sabrina-shanman Date: Mon, 10 Jun 2019 14:00:05 -0700 Subject: [PATCH] Fix crash when using null DisplayPlugin in GraphicsEngine during shutdown --- interface/src/graphics/GraphicsEngine.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/interface/src/graphics/GraphicsEngine.cpp b/interface/src/graphics/GraphicsEngine.cpp index 4f8b86cc0c..7f9a612697 100644 --- a/interface/src/graphics/GraphicsEngine.cpp +++ b/interface/src/graphics/GraphicsEngine.cpp @@ -132,6 +132,10 @@ static const int THROTTLED_SIM_FRAME_PERIOD_MS = MSECS_PER_SECOND / THROTTLED_SI bool GraphicsEngine::shouldPaint() const { auto displayPlugin = qApp->getActiveDisplayPlugin(); + if (!displayPlugin) { + // We're shutting down + return false; + } #ifdef DEBUG_PAINT_DELAY static uint64_t paintDelaySamples{ 0 }; @@ -175,6 +179,10 @@ void GraphicsEngine::render_performFrame() { { PROFILE_RANGE(render, "/getActiveDisplayPlugin"); displayPlugin = qApp->getActiveDisplayPlugin(); + if (!displayPlugin) { + // We're shutting down + return; + } } {