fixed (fix as in hack) crash when std::string was used to store a command line argument

develop
mizipzor 2010-02-19 21:24:20 +01:00
parent adbf4b81b4
commit 7f404483f1
1 changed files with 11 additions and 9 deletions

@ -635,15 +635,17 @@ namespace
// The option and its associated value are removed, the subtle thing
// is that someother options might have this associated value too,
// which we must invalidate.
s.values_.erase(iter->second);
for (std::map<std::string,argstream::value_iterator>::iterator
jter = s.options_.begin();jter != s.options_.end();++jter)
{
if (jter->second == iter->second)
{
jter->second = s.values_.end();
}
}
s.values_.erase(iter->second);
// FIXME this loop seems to crash if a std::string is used as the value
//for (std::map<std::string,argstream::value_iterator>::iterator
// jter = s.options_.begin();jter != s.options_.end();++jter)
//{
// if (jter->second == iter->second)
// {
// jter->second = s.values_.end();
// }
//}
s.options_.erase(iter);
}
else