summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2017-11-21 14:32:50 +0100
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2017-11-21 23:16:44 +0000
commitd8288d2b65f748e986c06dfb117b04a0b73db182 (patch)
treea5cb41a4223949edc8441d8f1323a9327624b4e8 /src
parent68733e307f209487e89b9261256ec0c0bc2352e2 (diff)
iOS: Make sure FBOs are cleaned up in the right QIOSContext
655687d84d6a591422 shuffled things around, moving the logic to connect to the window's destroyed signal from backingFramebufferObjectFor into makeCurrent. Unfortunately backingFramebufferObjectFor was the one taking care of recursing into the root context (when shared contexts were in play), so the end result was that the root context were keeping track of the FBO, but the leaf context was trying to clean up the FBO. Task-number: QTBUG-56653 Change-Id: I80ed71a3dedeb7611b2aa7548d94b9fbe0e20763 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/platforms/ios/qioscontext.mm11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/plugins/platforms/ios/qioscontext.mm b/src/plugins/platforms/ios/qioscontext.mm
index 2d5286e971..6a6cbb4324 100644
--- a/src/plugins/platforms/ios/qioscontext.mm
+++ b/src/plugins/platforms/ios/qioscontext.mm
@@ -165,8 +165,6 @@ bool QIOSContext::makeCurrent(QPlatformSurface *surface)
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER,
framebufferObject.depthRenderbuffer);
}
-
- connect(static_cast<QIOSWindow *>(surface), SIGNAL(destroyed(QObject*)), this, SLOT(windowDestroyed(QObject*)));
} else {
glBindFramebuffer(GL_FRAMEBUFFER, framebufferObject.handle);
}
@@ -249,8 +247,13 @@ QIOSContext::FramebufferObject &QIOSContext::backingFramebufferObjectFor(QPlatfo
// should probably use QOpenGLMultiGroupSharedResource to track the shared default-FBOs.
if (m_sharedContext)
return m_sharedContext->backingFramebufferObjectFor(surface);
- else
- return m_framebufferObjects[surface];
+
+ if (!m_framebufferObjects.contains(surface)) {
+ // We're about to create a new FBO, make sure it's cleaned up as well
+ connect(static_cast<QIOSWindow *>(surface), SIGNAL(destroyed(QObject*)), this, SLOT(windowDestroyed(QObject*)));
+ }
+
+ return m_framebufferObjects[surface];
}
GLuint QIOSContext::defaultFramebufferObject(QPlatformSurface *surface) const