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>
This commit is contained in:
Tor Arne Vestbø 2013-07-04 14:50:30 +02:00 committed by The Qt Project
parent 563c9445d4
commit 28c82a65a4

View File

@ -190,8 +190,11 @@ void QIOSContext::windowDestroyed(QObject *object)
{ {
QWindow *window = static_cast<QWindow *>(object); QWindow *window = static_cast<QWindow *>(object);
if (m_framebufferObjects.contains(window)) { if (m_framebufferObjects.contains(window)) {
EAGLContext *originalContext = [EAGLContext currentContext];
[EAGLContext setCurrentContext:m_eaglContext];
deleteBuffers(m_framebufferObjects[window]); deleteBuffers(m_framebufferObjects[window]);
m_framebufferObjects.remove(window); m_framebufferObjects.remove(window);
[EAGLContext setCurrentContext:originalContext];
} }
} }