diff options
author | Antti Määttä <antti.maatta@qt.io> | 2019-06-27 09:50:28 +0300 |
---|---|---|
committer | Antti Määttä <antti.maatta@qt.io> | 2019-06-28 09:31:51 +0300 |
commit | abd87f99983f103d38085bb732ef291516bf5055 (patch) | |
tree | 72d47f57d4720568d1f3f32d4c346b8fc24e371a | |
parent | 9677851febf223cb3e74aa0d11edf95d0c08b919 (diff) |
Fix crash in format discovery
Simpleqml example crashes with the lambda approach. Change to regular
function.
Task-number: QT3DS-3721
Change-Id: I6cddd2b70c47bfb27fb2e87db02bf80a84285751
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
-rw-r--r-- | src/foundation/qt/formatdiscovery.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/foundation/qt/formatdiscovery.cpp b/src/foundation/qt/formatdiscovery.cpp index 7ea762b..0a4bcbd 100644 --- a/src/foundation/qt/formatdiscovery.cpp +++ b/src/foundation/qt/formatdiscovery.cpp @@ -104,22 +104,22 @@ static QSurfaceFormat findIdealGLESVersion() return fmt; } +static QSurfaceFormat s_f; + QSurfaceFormat surfaceFormat() { - static const QSurfaceFormat f = [] { - QSurfaceFormat fmt; + if (s_f.renderableType() == QSurfaceFormat::DefaultRenderableType) { // works in dynamic gl builds too because there's a qguiapp already // this requirement is also a problem, see QT3DS-3603 if (QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGL) - fmt = findIdealGLVersion(); + s_f = findIdealGLVersion(); else - fmt = findIdealGLESVersion(); - fmt.setDepthBufferSize(24); - fmt.setStencilBufferSize(8); + s_f = findIdealGLESVersion(); + s_f.setDepthBufferSize(24); + s_f.setStencilBufferSize(8); // Ignore MSAA here as that is a per-layer setting. - return fmt; - }(); - return f; + } + return s_f; } } // End namespace Q3DS |