diff options
-rw-r--r-- | src/plugins/platforms/ios/qiosbackingstore.mm | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/plugins/platforms/ios/qiosbackingstore.mm b/src/plugins/platforms/ios/qiosbackingstore.mm index 076e34c1a5..96be28af81 100644 --- a/src/plugins/platforms/ios/qiosbackingstore.mm +++ b/src/plugins/platforms/ios/qiosbackingstore.mm @@ -122,7 +122,17 @@ QIOSBackingStore::QIOSBackingStore(QWindow *window) QIOSBackingStore::~QIOSBackingStore() { - delete m_context; + 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; } |