forked from organicmaps/organicmaps
[editor] Insert/load edited and created features only after successful initialization.
This commit is contained in:
parent
85d6bd2c08
commit
0f1acded75
1 changed files with 3 additions and 2 deletions
|
@ -189,8 +189,7 @@ void Editor::LoadMapEdits()
|
|||
if (needMigrateEdits && IsObsolete(xml, fid))
|
||||
continue;
|
||||
|
||||
FeatureTypeInfo & fti = m_features[fid.m_mwmId][fid.m_index];
|
||||
|
||||
FeatureTypeInfo fti;
|
||||
if (section.first == FeatureStatus::Created)
|
||||
{
|
||||
fti.m_feature.FromXML(xml);
|
||||
|
@ -217,6 +216,8 @@ void Editor::LoadMapEdits()
|
|||
case FeatureStatus::Created: ++created; break;
|
||||
case FeatureStatus::Untouched: ASSERT(false, ()); break;
|
||||
}
|
||||
// Insert initialized structure at the end: exceptions are possible in above code.
|
||||
m_features[fid.m_mwmId].emplace(fid.m_index, move(fti));
|
||||
}
|
||||
catch (editor::XMLFeatureError const & ex)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue