Fix an occasional crash on startup on Windows debug builds

Some of the debug iterator code seems to not like 'delete map[key]', so
change things a little to do things in a way that appears to be fine.
This commit is contained in:
Thomas Goyne 2012-10-16 09:47:06 -07:00
parent 181208a531
commit 4c116526d2
1 changed files with 4 additions and 3 deletions

View File

@ -144,11 +144,12 @@ void ConfigVisitor::AddOptionValue(OptionValue* opt) {
return;
}
if (!values.count(name))
OptionValueMap::iterator it = values.find(name);
if (it == values.end())
values[name] = opt;
else if (replace) {
delete values[name];
values[name] = opt;
delete it->second;
it->second = opt;
}
else {
try {