From 4a41f37d5d0c8b3be91205f3e4e21671a7cf3f63 Mon Sep 17 00:00:00 2001 From: binary1248 Date: Sun, 3 Jun 2018 18:55:23 +0200 Subject: [PATCH] Fixed stale FBOs not being erased from the staleFramebuffers set after they have been deleted. --- src/SFML/Graphics/RenderTextureImplFBO.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/SFML/Graphics/RenderTextureImplFBO.cpp b/src/SFML/Graphics/RenderTextureImplFBO.cpp index 4a4f1f62e..c0debd794 100644 --- a/src/SFML/Graphics/RenderTextureImplFBO.cpp +++ b/src/SFML/Graphics/RenderTextureImplFBO.cpp @@ -60,12 +60,18 @@ namespace { sf::Uint64 contextId = sf::Context::getActiveContextId(); - for (std::set >::iterator iter = staleFrameBuffers.begin(); iter != staleFrameBuffers.end(); ++iter) + for (std::set >::iterator iter = staleFrameBuffers.begin(); iter != staleFrameBuffers.end();) { if (iter->first == contextId) { GLuint frameBuffer = static_cast(iter->second); glCheck(GLEXT_glDeleteFramebuffers(1, &frameBuffer)); + + staleFrameBuffers.erase(iter++); + } + else + { + ++iter; } } }