aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/quick/scenegraph/qsgthreadedrenderloop.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/quick/scenegraph/qsgthreadedrenderloop.cpp b/src/quick/scenegraph/qsgthreadedrenderloop.cpp
index a8668fd0c0..9b520d53f2 100644
--- a/src/quick/scenegraph/qsgthreadedrenderloop.cpp
+++ b/src/quick/scenegraph/qsgthreadedrenderloop.cpp
@@ -810,6 +810,11 @@ void QSGRenderThread::syncAndRender()
QQuickProfiler::SceneGraphRenderLoopSync, 1);
Q_TRACE(QSG_swap_entry);
qCDebug(QSG_LOG_RENDERLOOP, QSG_RT_PAD, "- window not ready, skipping render");
+ // Make sure a beginFrame() always gets an endFrame(). We could have
+ // started a frame but then not have a valid renderer (if there was no
+ // sync). So gracefully handle that.
+ if (cd->swapchain && rhi->isRecordingFrame())
+ rhi->endFrame(cd->swapchain, QRhi::SkipPresent);
}
qCDebug(QSG_LOG_RENDERLOOP, QSG_RT_PAD, "- rendering done");