iOS: Ensure that QPlatformBackingStore can clean up textures in dtor
We are using QPlatformBackingStore::composeAndFlush, which allocates textures on our behalf using the context that we pass in, so we need to keep the context alive (and make it current) for the duration of the QPlatformBackingStore destructor, otherwise we're leaking textures every time a window (dialog e.g.) is closed. Change-Id: I1450fa0ff7a170d13ec59920566e4401b50cd513 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
This commit is contained in:
parent
3c99bddb84
commit
5da5586a96
@ -122,7 +122,17 @@ QIOSBackingStore::QIOSBackingStore(QWindow *window)
|
||||
|
||||
QIOSBackingStore::~QIOSBackingStore()
|
||||
{
|
||||
if (window()->surfaceType() == QSurface::RasterGLSurface) {
|
||||
// We're using composeAndFlush from QPlatformBackingStore, which
|
||||
// need to clean up any textures in its destructor, so make the
|
||||
// context current and keep it alive until QPlatformBackingStore
|
||||
// has cleaned up everything.
|
||||
makeCurrent();
|
||||
m_context->deleteLater();
|
||||
} else {
|
||||
delete m_context;
|
||||
}
|
||||
|
||||
delete m_glDevice;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user