summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
authorJocelyn Turcotte <jocelyn.turcotte@digia.com>2014-04-08 18:16:37 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-04-09 10:47:02 +0200
commit04f6dffbf9f9b476eed74006de15ad837162e04e (patch)
tree532cc9de93e2236f9f8893f320782e823536bba8 /src/widgets
parent1d58ec346ae566a2065aae7acaf3526f28fd6473 (diff)
QOpenGLWidget: Avoid crashing if updateGL is called before the first resize
Change-Id: I9e7788334de98b35dc5d6beee97a63783a1fe267 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/kernel/qopenglwidget.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/widgets/kernel/qopenglwidget.cpp b/src/widgets/kernel/qopenglwidget.cpp
index d9bc2f7bbd..10be5aef16 100644
--- a/src/widgets/kernel/qopenglwidget.cpp
+++ b/src/widgets/kernel/qopenglwidget.cpp
@@ -147,6 +147,9 @@ void QOpenGLWidget::paintGL()
void QOpenGLWidget::updateGL()
{
Q_D(QOpenGLWidget);
+ if (d->uninitialized)
+ return;
+
makeCurrent();
paintGL();
d->context.functions()->glFlush();