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 d2ececed05
commit 93ad872f9e

View File

@ -60,12 +60,18 @@ namespace
{ {
sf::Uint64 contextId = sf::Context::getActiveContextId(); 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) if (iter->first == contextId)
{ {
GLuint frameBuffer = static_cast<GLuint>(iter->second); GLuint frameBuffer = static_cast<GLuint>(iter->second);
glCheck(GLEXT_glDeleteFramebuffers(1, &frameBuffer)); glCheck(GLEXT_glDeleteFramebuffers(1, &frameBuffer));
staleFrameBuffers.erase(iter++);
}
else
{
++iter;
} }
} }
} }