Don't crash when QOpenGLPaintDevice is created without context.

Change-Id: Ic826158a1570ec49e9847cf040ce897a682048db
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
This commit is contained in:
Gunnar Sletta 2015-10-16 07:36:59 +02:00
parent c890fa4787
commit 2e3ebcd1d4

View File

@ -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;
}