summaryrefslogtreecommitdiffstats
path: root/src/gui/opengl/qopenglvertexarrayobject.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/opengl/qopenglvertexarrayobject.cpp')
-rw-r--r--src/gui/opengl/qopenglvertexarrayobject.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/gui/opengl/qopenglvertexarrayobject.cpp b/src/gui/opengl/qopenglvertexarrayobject.cpp
index 6b0f2fede7..2a1b7f4bf4 100644
--- a/src/gui/opengl/qopenglvertexarrayobject.cpp
+++ b/src/gui/opengl/qopenglvertexarrayobject.cpp
@@ -189,11 +189,16 @@ bool QOpenGLVertexArrayObjectPrivate::create()
void QOpenGLVertexArrayObjectPrivate::destroy()
{
+ Q_Q(QOpenGLVertexArrayObject);
+
+ if (context) {
+ QObject::disconnect(context, SIGNAL(aboutToBeDestroyed()), q, SLOT(_q_contextAboutToBeDestroyed()));
+ context = 0;
+ }
+
if (!vao)
return;
- Q_Q(QOpenGLVertexArrayObject);
-
switch (vaoFuncsType) {
#ifndef QT_OPENGL_ES_2
case Core_3_2:
@@ -212,10 +217,6 @@ void QOpenGLVertexArrayObjectPrivate::destroy()
break;
}
- Q_ASSERT(context);
- QObject::disconnect(context, SIGNAL(aboutToBeDestroyed()), q, SLOT(_q_contextAboutToBeDestroyed()));
- context = 0;
-
vao = 0;
}