From db39b4e7d4e4b96d1fba56528aa08011dfd44d5d Mon Sep 17 00:00:00 2001 From: psi29a Date: Tue, 20 Jul 2021 18:44:44 +0000 Subject: [PATCH] Merge branch 'fix-iterator-badness' into 'master' Actually increment iterators to be erased. Closes #6163 See merge request OpenMW/openmw!1027 (cherry picked from commit 7c246b28e7cb8c514b22214309fc9fed7fc40edc) 5ec2ddb4 Actually increment iterators to be erased. --- components/shader/shadervisitor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/shader/shadervisitor.cpp b/components/shader/shadervisitor.cpp index ebf9d40c4..9550c903a 100644 --- a/components/shader/shadervisitor.cpp +++ b/components/shader/shadervisitor.cpp @@ -603,7 +603,7 @@ namespace Shader for (auto itr = writableStateSet->getUniformList().begin(); itr != writableStateSet->getUniformList().end();) { if (addedState->hasUniform(itr->first)) - writableStateSet->getUniformList().erase(itr); + writableStateSet->getUniformList().erase(itr++); else ++itr; } @@ -611,7 +611,7 @@ namespace Shader for (auto itr = writableStateSet->getModeList().begin(); itr != writableStateSet->getModeList().end();) { if (addedState->hasMode(itr->first)) - writableStateSet->getModeList().erase(itr); + writableStateSet->getModeList().erase(itr++); else ++itr; }