From 2e3ebcd1d4d04dece0ac0427afae4cce7c417926 Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Fri, 16 Oct 2015 07:36:59 +0200 Subject: [PATCH] Don't crash when QOpenGLPaintDevice is created without context. Change-Id: Ic826158a1570ec49e9847cf040ce897a682048db Reviewed-by: Laszlo Agocs --- src/gui/opengl/qopenglpaintengine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/opengl/qopenglpaintengine.cpp b/src/gui/opengl/qopenglpaintengine.cpp index a9a4adaddc..4836dde343 100644 --- a/src/gui/opengl/qopenglpaintengine.cpp +++ b/src/gui/opengl/qopenglpaintengine.cpp @@ -2076,7 +2076,7 @@ bool QOpenGL2PaintEngineEx::begin(QPaintDevice *pdev) d->device->ensureActiveTarget(); - if (d->device->context() != QOpenGLContext::currentContext()) { + if (d->device->context() != QOpenGLContext::currentContext() || !d->device->context()) { qWarning("QPainter::begin(): QOpenGLPaintDevice's context needs to be current"); return false; }