Fixed stale FBOs not being erased from the staleFramebuffers set after they have been deleted.

This commit is contained in:
binary1248 2018-06-03 18:55:23 +02:00 committed by Lukas Dürrenberger
parent b9303866a6
commit 4a41f37d5d

View File

@ -60,12 +60,18 @@ namespace
{
sf::Uint64 contextId = sf::Context::getActiveContextId();
for (std::set<std::pair<sf::Uint64, unsigned int> >::iterator iter = staleFrameBuffers.begin(); iter != staleFrameBuffers.end(); ++iter)
for (std::set<std::pair<sf::Uint64, unsigned int> >::iterator iter = staleFrameBuffers.begin(); iter != staleFrameBuffers.end();)
{
if (iter->first == contextId)
{
GLuint frameBuffer = static_cast<GLuint>(iter->second);
glCheck(GLEXT_glDeleteFramebuffers(1, &frameBuffer));
staleFrameBuffers.erase(iter++);
}
else
{
++iter;
}
}
}