From 068732fc9e1d3aaf2c353ad5bf4311e16fb46531 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20K=C3=A4fer?= Date: Wed, 28 Sep 2016 17:50:24 +0200 Subject: [core] don't iterate too much over program objects scheduled for deletion --- src/mbgl/gl/context.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/mbgl/gl') diff --git a/src/mbgl/gl/context.cpp b/src/mbgl/gl/context.cpp index fbe7b39a6f..03b0e7abdb 100644 --- a/src/mbgl/gl/context.cpp +++ b/src/mbgl/gl/context.cpp @@ -61,10 +61,8 @@ void Context::setDirtyState() { void Context::performCleanup() { for (GLuint id : abandonedPrograms) { - for (const auto& p : abandonedPrograms) { - if (program == p) { - program.setDirty(); - } + if (program == id) { + program.setDirty(); } MBGL_CHECK_ERROR(glDeleteProgram(id)); } -- cgit v1.2.1