aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2020-06-15 13:23:30 +0200
committerUlf Hermann <ulf.hermann@qt.io>2020-06-17 17:16:40 +0200
commit48e919e9647fd07351be37e1ad7efdda9c550be9 (patch)
treec6b9de8fe6229ae3d19c77e587e2f3377c016f9f
parent22fff824c95525ae3e003fafe34a4a9e680affcb (diff)
SceneGraph: Check for existing offscreen surface before creating one
Otherwise the old one leaks as shown in the QQuickWindow test. Change-Id: I50a8c1b5e7ebc52a2bf9a901d9fae94559d2bcea Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
-rw-r--r--src/quick/scenegraph/qsgthreadedrenderloop.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/quick/scenegraph/qsgthreadedrenderloop.cpp b/src/quick/scenegraph/qsgthreadedrenderloop.cpp
index 31affaff83..8410ff25aa 100644
--- a/src/quick/scenegraph/qsgthreadedrenderloop.cpp
+++ b/src/quick/scenegraph/qsgthreadedrenderloop.cpp
@@ -1270,7 +1270,8 @@ void QSGThreadedRenderLoop::handleExposure(QQuickWindow *window)
if (!w->thread->rhi) {
QSGRhiSupport *rhiSupport = QSGRhiSupport::instance();
- w->thread->offscreenSurface = rhiSupport->maybeCreateOffscreenSurface(window);
+ if (!w->thread->offscreenSurface)
+ w->thread->offscreenSurface = rhiSupport->maybeCreateOffscreenSurface(window);
window->installEventFilter(this);
}