diff options
Diffstat (limited to 'src/opengl/qgl.cpp')
-rw-r--r-- | src/opengl/qgl.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index 19858e7..4698a5c 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -5606,6 +5606,21 @@ void *QGLContextGroupResourceBase::value(const QGLContext *context) return group->m_resources.value(this, 0); } +void QGLContextGroupResourceBase::cleanup(const QGLContext *ctx) +{ + void *resource = value(ctx); + + if (resource != 0) { + QGLShareContextScope scope(ctx); + freeResource(resource); + + QGLContextGroup *group = QGLContextPrivate::contextGroup(ctx); + group->m_resources.remove(this); + m_groups.removeOne(group); + active.deref(); + } +} + void QGLContextGroupResourceBase::cleanup(const QGLContext *ctx, void *value) { #ifdef QT_GL_CONTEXT_RESOURCE_DEBUG |