From b300c3022d285deb3b3203aca0746580ba9f3d91 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Thu, 10 Sep 2009 11:08:46 +0200 Subject: Fix crash in gl2 paint engine on Windows wglGetProcAddress() on Windows requires a current context. Since there was none, the resolution of GL extensions would silently fail, the function pointers would be null and when we tried to use them later we would get a crash (e.g. in startup of PadNavigator.) I've added an assert to make the cause of the crash clearer, and a makeCurrent() to fix the crash. Reviewed-by: Tom --- src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp index c87941b..f8095bf 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp @@ -1328,7 +1328,9 @@ bool QGL2PaintEngineEx::begin(QPaintDevice *pdev) d->mode = BrushDrawingMode; #if !defined(QT_OPENGL_ES_2) - qt_resolve_version_2_0_functions(d->ctx); + d->ctx->makeCurrent(); + bool success = qt_resolve_version_2_0_functions(d->ctx); + Q_ASSERT(success); #endif d->shaderManager = new QGLEngineShaderManager(d->ctx); -- cgit v0.12