QOpenGLContext: Handle versionFunctions like other data
While probably not common, it is not unthinkable that one does a destroy() - create() on a QOpenGLContext while relying on the versioned function wrappers. This is likely broken at the moment since the internal data is not released on destroy(), only when the QOpenGLContext is deleted. This differs from any other similar data (the portable function resolvers, QOpenGLTexture backing data, etc.) which are all dropped and nulled out in destroy(). Also remove the bizarre comment in the dtor which must be something from Qt 4 / QGLWidget times. Note that this does not fix the associated problem since that only relies on the standard mechanism that leads to fully destroying and then recreating the QOpenGLContext when the window changes. Pick-to: 6.5 Task-number: QTBUG-109171 Change-Id: Id265a1d208ffae3792a0608c29324e840ce690dc Reviewed-by: Christian Strømme <christian.stromme@qt.io>
This commit is contained in:
parent
f045ef4ab6
commit
3bad6d5970
@ -362,10 +362,6 @@ bool QOpenGLContext::create()
|
||||
|
||||
QOpenGLContextPrivate::~QOpenGLContextPrivate()
|
||||
{
|
||||
//do not delete the QOpenGLContext handle here as it is deleted in
|
||||
//QWidgetPrivate::deleteTLSysExtra()
|
||||
|
||||
delete versionFunctions;
|
||||
}
|
||||
|
||||
void QOpenGLContextPrivate::adopt(QPlatformOpenGLContext *context)
|
||||
@ -416,6 +412,9 @@ void QOpenGLContext::destroy()
|
||||
}
|
||||
d->textureFunctions = nullptr;
|
||||
|
||||
delete d->versionFunctions;
|
||||
d->versionFunctions = nullptr;
|
||||
|
||||
if (d->vaoHelperDestroyCallback) {
|
||||
Q_ASSERT(d->vaoHelper);
|
||||
d->vaoHelperDestroyCallback(d->vaoHelper);
|
||||
|
Loading…
x
Reference in New Issue
Block a user