Gui: fix memory leak in QGuiGLThreadContext
`QCoreApplicationPrivate::cleanupThreadData` calls `~QGuiGLThreadContext`, which calls `QOpenGLContextPrivate::setCurrentContext`, which creates a new `QGuiGLThreadContext`, which is not destroyed anymore. since `~QGuiGLThreadContext` sets a nullptr we exit early. Fixes: QTBUG-124538 Pick-to: 6.7 Change-Id: I51e40fcf8fd1169a4dfd336fac9c82f44d42f68e Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>bb10
parent
8d8cbe87e2
commit
d139642aef
|
|
@ -170,6 +170,9 @@ QOpenGLContext *QOpenGLContextPrivate::setCurrentContext(QOpenGLContext *context
|
|||
qWarning("No QTLS available. currentContext won't work");
|
||||
return nullptr;
|
||||
}
|
||||
if (!context)
|
||||
return nullptr;
|
||||
|
||||
threadContext = new QGuiGLThreadContext;
|
||||
qwindow_context_storage()->setLocalData(threadContext);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue