diff options
Diffstat (limited to 'src/gui/kernel/qopenglcontext.cpp')
-rw-r--r-- | src/gui/kernel/qopenglcontext.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/gui/kernel/qopenglcontext.cpp b/src/gui/kernel/qopenglcontext.cpp index 6a9cb43028..93a4b3582b 100644 --- a/src/gui/kernel/qopenglcontext.cpp +++ b/src/gui/kernel/qopenglcontext.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** @@ -174,6 +174,8 @@ bool QOpenGLContext::create() void QOpenGLContext::destroy() { Q_D(QOpenGLContext); + if (d->platformGLContext) + emit aboutToBeDestroyed(); if (QOpenGLContext::currentContext() == this) doneCurrent(); if (d->shareGroup) @@ -186,6 +188,17 @@ void QOpenGLContext::destroy() } /*! + \fn void QOpenGLContext::aboutToBeDestroyed() + + This signal is emitted before the underlying native OpenGL context is + destroyed, such that users may clean up OpenGL resources that might otherwise + be left dangling in the case of shared OpenGL contexts. + + If you wish to make the context current in order to do clean-up, make sure to + only connect to the signal using a direct connection. +*/ + +/*! If this is the current context for the thread, doneCurrent is called */ QOpenGLContext::~QOpenGLContext() @@ -297,7 +310,7 @@ void QOpenGLContext::swapBuffers(QSurface *surface) d->platformGLContext->swapBuffers(surfaceHandle); } -void (*QOpenGLContext::getProcAddress(const QByteArray &procName)) () +QFunctionPointer QOpenGLContext::getProcAddress(const QByteArray &procName) { Q_D(QOpenGLContext); if (!d->platformGLContext) |