diff options
Diffstat (limited to 'src/gui/opengl/qopenglvertexarrayobject.cpp')
-rw-r--r-- | src/gui/opengl/qopenglvertexarrayobject.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/gui/opengl/qopenglvertexarrayobject.cpp b/src/gui/opengl/qopenglvertexarrayobject.cpp index b1fd4ffdfe..22ca35a8c3 100644 --- a/src/gui/opengl/qopenglvertexarrayobject.cpp +++ b/src/gui/opengl/qopenglvertexarrayobject.cpp @@ -149,8 +149,6 @@ bool QOpenGLVertexArrayObjectPrivate::create() } Q_Q(QOpenGLVertexArrayObject); - if (context) - QObject::disconnect(context, SIGNAL(aboutToBeDestroyed()), q, SLOT(_q_contextAboutToBeDestroyed())); QOpenGLContext *ctx = QOpenGLContext::currentContext(); if (!ctx) { @@ -202,6 +200,8 @@ void QOpenGLVertexArrayObjectPrivate::destroy() if (!vao) return; + Q_Q(QOpenGLVertexArrayObject); + switch (vaoFuncsType) { #ifndef QT_OPENGL_ES_2 case Core_3_2: @@ -220,6 +220,10 @@ void QOpenGLVertexArrayObjectPrivate::destroy() break; } + Q_ASSERT(context); + QObject::disconnect(context, SIGNAL(aboutToBeDestroyed()), q, SLOT(_q_contextAboutToBeDestroyed())); + context = 0; + vao = 0; } |