Commit 92001e4e authored by David Thompson's avatar David Thompson

Fix a crash due to bad STL iterage.

parent 371fd07d
...@@ -42,11 +42,15 @@ std::set<Operation::Index> ExporterGroup::operationsForResourceAndFileName( ...@@ -42,11 +42,15 @@ std::set<Operation::Index> ExporterGroup::operationsForResourceAndFileName(
void ExporterGroup::filterOperationsThatRejectFileName( void ExporterGroup::filterOperationsThatRejectFileName(
std::set<Operation::Index>& ops, const std::string& fileName) const std::set<Operation::Index>& ops, const std::string& fileName) const
{ {
for (auto index = ops.begin(); index != ops.end(); ++index) for (auto index = ops.begin(); index != ops.end();)
{ {
if (fileItemDefinitionForOperation(*index)->isValueValid(fileName) == false) if (fileItemDefinitionForOperation(*index)->isValueValid(fileName) == false)
{ {
ops.erase(index); ops.erase(index++);
}
else
{
++index;
} }
} }
} }
......
...@@ -42,11 +42,15 @@ std::set<Operation::Index> ImporterGroup::operationsForResourceAndFileName( ...@@ -42,11 +42,15 @@ std::set<Operation::Index> ImporterGroup::operationsForResourceAndFileName(
void ImporterGroup::filterOperationsThatRejectFileName( void ImporterGroup::filterOperationsThatRejectFileName(
std::set<Operation::Index>& ops, const std::string& fileName) const std::set<Operation::Index>& ops, const std::string& fileName) const
{ {
for (auto index = ops.begin(); index != ops.end(); ++index) for (auto index = ops.begin(); index != ops.end();)
{ {
if (fileItemDefinitionForOperation(*index)->isValueValid(fileName) == false) if (fileItemDefinitionForOperation(*index)->isValueValid(fileName) == false)
{ {
ops.erase(index); ops.erase(index++);
}
else
{
++index;
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment