diff options
author | Anton Kreuzkamp <anton.kreuzkamp@kdab.com> | 2020-02-12 12:48:47 +0100 |
---|---|---|
committer | Anton Kreuzkamp <anton.kreuzkamp@kdab.com> | 2020-02-12 16:38:09 +0100 |
commit | ac0ce38dcfeeded87db0c1dd5d348f5ed6fc1af3 (patch) | |
tree | b2abd2a5dde9b167313d67f1dfb59e6ab1f0a6ae | |
parent | 1a7ca47a7a92945e16006ddd00adea186535cdd5 (diff) |
Add a null check to QQuickWindowPrivate::renderer
Afaik there currently is no case in a regular execution where the
renderer would actually be null, but for the sake of correctness add a
null check as this seems to be the only code location that actually
assumes the renderer to be non-null.
Additionally, in order to en-/disable custom render modes at runtime,
GammaRay actually needs to recreate the renderer and therefore resets
the renderer to null in order for QQuickWindowPrivate::syncSceneGraph to
recreate it. Thus we need a null check to make sure we don't crash in
the short time frame where the renderer is null.
Change-Id: Ief5c405f3bc8725d55e22cd33f2164830764e33d
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
-rw-r--r-- | src/quick/items/qquickwindow.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp index faa22ec83f..f07136fcd3 100644 --- a/src/quick/items/qquickwindow.cpp +++ b/src/quick/items/qquickwindow.cpp @@ -548,7 +548,7 @@ void QQuickWindowPrivate::renderSceneGraph(const QSize &size, const QSize &surfa else context->endNextFrame(renderer); - if (renderer->hasCustomRenderModeWithContinuousUpdate()) { + if (renderer && renderer->hasCustomRenderModeWithContinuousUpdate()) { // For the overdraw visualizer. This update is not urgent so avoid a // direct update() call, this is only here to keep the overdraw // visualization box rotating even when the scene is static. |