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:
parent
c890fa4787
commit
2e3ebcd1d4
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user