summaryrefslogtreecommitdiffstats
path: root/src/opengl
diff options
context:
space:
mode:
authorTatiana Borisova <tatiana.borisova@qt.io>2022-01-20 19:29:35 +0200
committerTatiana Borisova <tatiana.borisova@qt.io>2022-01-25 02:59:36 +0200
commitb5124d9719ff5609832e02cd2b555966a6646b8f (patch)
treee8aa4427fb40ba630b639c83e10427bcb6544eaa /src/opengl
parent406bb6ae20471cf9bba6d910256b416792c99322 (diff)
Fix run time failure for UI autotests (INTEGRITY)
- Add WFD resources release: It provides possibility to re-create native window on run time. It allows to run several Qt UI applications (one by one) without device reboot. - Fix crash that found during window re-creation: ~QOpenGLCompositorBacking() calls QOpenGLCompositor::instance(). But compositor is deleted for that moment. Task-number: QTBUG-99123 Pick-to: 6.2 6.3 Change-Id: I1e6dc9a012a166d1fd6cd1c24f9d2e9a8995fc00 Reviewed-by: Kimmo Ollila <kimmo.ollila@qt.io> Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src/opengl')
-rw-r--r--src/opengl/qopenglcompositorbackingstore.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/opengl/qopenglcompositorbackingstore.cpp b/src/opengl/qopenglcompositorbackingstore.cpp
index 40400e2a19..34542dde47 100644
--- a/src/opengl/qopenglcompositorbackingstore.cpp
+++ b/src/opengl/qopenglcompositorbackingstore.cpp
@@ -95,18 +95,20 @@ QOpenGLCompositorBackingStore::~QOpenGLCompositorBackingStore()
QScopedPointer<QOffscreenSurface> tempSurface;
if (!ctx) {
ctx = QOpenGLCompositor::instance()->context();
- tempSurface.reset(new QOffscreenSurface);
- tempSurface->setFormat(ctx->format());
- tempSurface->create();
- ctx->makeCurrent(tempSurface.data());
+ if (ctx) {
+ tempSurface.reset(new QOffscreenSurface);
+ tempSurface->setFormat(ctx->format());
+ tempSurface->create();
+ ctx->makeCurrent(tempSurface.data());
+ }
}
- if (m_bsTextureContext && ctx->shareGroup() == m_bsTextureContext->shareGroup())
+ if (m_bsTextureContext && ctx && ctx->shareGroup() == m_bsTextureContext->shareGroup())
glDeleteTextures(1, &m_bsTexture);
else
qWarning("QOpenGLCompositorBackingStore: Texture is not valid in the current context");
- if (tempSurface)
+ if (tempSurface && ctx)
ctx->doneCurrent();
}