From 28c82a65a4d4817bd4dcea050f5fb3f036257d2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Thu, 4 Jul 2013 14:50:30 +0200 Subject: iOS: Make sure we're deleting framebuffers in the right context When a QWindow was destroyed, we'd delete its corresponding buffers, but failed to make the correct EAGLContext current first. This would result in deleting/invalidating buffers for another window (whatever window's context was current at the time), and that window would then seemingly stop rendering anything, and turn black on rotation. Task-number: QTBUG-32246 Change-Id: I335a8c580203fc01e43da31c5cb6f567614c26fc Reviewed-by: Richard Moe Gustavsen Reviewed-by: Gunnar Sletta --- src/plugins/platforms/ios/qioscontext.mm | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/plugins/platforms/ios') diff --git a/src/plugins/platforms/ios/qioscontext.mm b/src/plugins/platforms/ios/qioscontext.mm index 735dd26b6d..87bcc01d04 100644 --- a/src/plugins/platforms/ios/qioscontext.mm +++ b/src/plugins/platforms/ios/qioscontext.mm @@ -190,8 +190,11 @@ void QIOSContext::windowDestroyed(QObject *object) { QWindow *window = static_cast(object); if (m_framebufferObjects.contains(window)) { + EAGLContext *originalContext = [EAGLContext currentContext]; + [EAGLContext setCurrentContext:m_eaglContext]; deleteBuffers(m_framebufferObjects[window]); m_framebufferObjects.remove(window); + [EAGLContext setCurrentContext:originalContext]; } } -- cgit v1.2.3