1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-16 18:19:55 +00:00

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.
This commit is contained in:
psi29a 2021-07-20 18:44:44 +00:00
parent 59da0a0da9
commit db39b4e7d4

View file

@ -603,7 +603,7 @@ namespace Shader
for (auto itr = writableStateSet->getUniformList().begin(); itr != writableStateSet->getUniformList().end();) for (auto itr = writableStateSet->getUniformList().begin(); itr != writableStateSet->getUniformList().end();)
{ {
if (addedState->hasUniform(itr->first)) if (addedState->hasUniform(itr->first))
writableStateSet->getUniformList().erase(itr); writableStateSet->getUniformList().erase(itr++);
else else
++itr; ++itr;
} }
@ -611,7 +611,7 @@ namespace Shader
for (auto itr = writableStateSet->getModeList().begin(); itr != writableStateSet->getModeList().end();) for (auto itr = writableStateSet->getModeList().begin(); itr != writableStateSet->getModeList().end();)
{ {
if (addedState->hasMode(itr->first)) if (addedState->hasMode(itr->first))
writableStateSet->getModeList().erase(itr); writableStateSet->getModeList().erase(itr++);
else else
++itr; ++itr;
} }