summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/ios
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@digia.com>2013-07-04 14:50:30 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-07-05 11:36:22 +0200
commit28c82a65a4d4817bd4dcea050f5fb3f036257d2f (patch)
tree8c777bf3f3cddf9318909996074c132b03fed449 /src/plugins/platforms/ios
parent563c9445d4df8d38f776daf46a8132f90981e6d1 (diff)
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 <richard.gustavsen@digia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Diffstat (limited to 'src/plugins/platforms/ios')
-rw-r--r--src/plugins/platforms/ios/qioscontext.mm3
1 files changed, 3 insertions, 0 deletions
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<QWindow *>(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];
}
}