Fix crash (use iterator of same container for loop)
This commit is contained in:
parent
63427fc589
commit
9604142d09
1 changed files with 5 additions and 3 deletions
|
@ -490,10 +490,12 @@ static void initAircraftDirsNasalSecurity()
|
||||||
{
|
{
|
||||||
SGPropertyNode* sim = fgGetNode("/sim", true);
|
SGPropertyNode* sim = fgGetNode("/sim", true);
|
||||||
sim->removeChildren("fg-aircraft");
|
sim->removeChildren("fg-aircraft");
|
||||||
string_list::const_iterator it;
|
|
||||||
int index = 0;
|
int index = 0;
|
||||||
for (it = globals->get_aircraft_paths().begin();
|
string_list const aircraft_paths = globals->get_aircraft_paths();
|
||||||
it != globals->get_aircraft_paths().end(); ++it, ++index)
|
for( string_list::const_iterator it = aircraft_paths.begin();
|
||||||
|
it != aircraft_paths.end();
|
||||||
|
++it, ++index )
|
||||||
{
|
{
|
||||||
SGPropertyNode* n = sim->getChild("fg-aircraft", index, true);
|
SGPropertyNode* n = sim->getChild("fg-aircraft", index, true);
|
||||||
n->setStringValue(*it);
|
n->setStringValue(*it);
|
||||||
|
|
Loading…
Add table
Reference in a new issue