From 93ad872f9ebe1fd59b694467960610851263f7d9 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 4a4f1f62..c0debd79 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; } } }