summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gui/opengl/qopenglvertexarrayobject.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gui/opengl/qopenglvertexarrayobject.cpp b/src/gui/opengl/qopenglvertexarrayobject.cpp
index 7f130505ec..e450fe708f 100644
--- a/src/gui/opengl/qopenglvertexarrayobject.cpp
+++ b/src/gui/opengl/qopenglvertexarrayobject.cpp
@@ -146,6 +146,7 @@ bool QOpenGLVertexArrayObjectPrivate::create()
qWarning("QOpenGLVertexArrayObject::create() requires a valid current OpenGL context");
return false;
}
+ context = ctx;
#if defined(QT_OPENGL_ES_2)
if (ctx->hasExtension("GL_OES_vertex_array_object")) {
@@ -326,7 +327,7 @@ QOpenGLVertexArrayObject::~QOpenGLVertexArrayObject()
Q_D(QOpenGLVertexArrayObject);
QOpenGLContext *oldContext = 0;
- if (d->context != ctx) {
+ if (d->context && d->context != ctx) {
oldContext = ctx;
if (d->context->makeCurrent(oldContext->surface())) {
ctx = d->context;