forked from mia/Aegisub
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:
parent
712a5e0d8b
commit
682c7d5371
1 changed files with 4 additions and 3 deletions
|
@ -144,11 +144,12 @@ void ConfigVisitor::AddOptionValue(OptionValue* opt) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!values.count(name))
|
OptionValueMap::iterator it = values.find(name);
|
||||||
|
if (it == values.end())
|
||||||
values[name] = opt;
|
values[name] = opt;
|
||||||
else if (replace) {
|
else if (replace) {
|
||||||
delete values[name];
|
delete it->second;
|
||||||
values[name] = opt;
|
it->second = opt;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in a new issue