#3623 Grid Items : Do not try to delete object twice

This commit is contained in:
Magne Sjaastad 2018-11-06 10:01:05 +01:00
parent 5e17eaf98a
commit 59c1f612fb

View File

@ -402,17 +402,16 @@ void RimGridCollection::syncFromMainGrid()
} }
} }
while (!allPersistentGrids.empty()) for (const auto& grid : allPersistentGrids)
{ {
auto gridName = allPersistentGrids.front()->name(); auto gridName = grid->name();
m_persistentLgrs->deleteGridInfo(gridName); m_persistentLgrs->deleteGridInfo(gridName);
removeGridInfo(gridName, allPersistentGrids);
} }
while (!allTemporaryGrids.empty())
for (const auto& grid : allTemporaryGrids)
{ {
auto gridName = allTemporaryGrids.front()->name(); auto gridName = grid->name();
m_temporaryLgrs->deleteGridInfo(allTemporaryGrids.front()->name()); m_temporaryLgrs->deleteGridInfo(gridName);
removeGridInfo(gridName, allTemporaryGrids);
} }
} }
updateConnectedEditors(); updateConnectedEditors();