summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSean Harmer <sean.harmer@kdab.com>2013-03-11 14:20:04 +0000
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-03-12 16:01:20 +0100
commitb80d130a5192a15eb53592b31e05be7cbee2c1ef (patch)
tree811d6ef94288d07764222f60a2a005d89f96702a /src
parent771286e01e610155fb1f96c3bc3a8fd238c20219 (diff)
Avoid crash in QVertexArrayObject destructor
Change-Id: If43c7b1cfdee504171a26b07db2ade9c20528299 Reviewed-by: Samuel Rødal <samuel.rodal@digia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
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;