Bugfix: guard against corrupted airport XML.
This commit is contained in:
parent
1b9394fc37
commit
d8a3f160ef
1 changed files with 34 additions and 21 deletions
|
@ -570,12 +570,16 @@ void FGAirport::loadSceneryDefinitions() const
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
flightgear::NavDataCache::Transaction txn(cache);
|
flightgear::NavDataCache::Transaction txn(cache);
|
||||||
SGPropertyNode_ptr rootNode = new SGPropertyNode;
|
SGPropertyNode_ptr rootNode = new SGPropertyNode;
|
||||||
readProperties(path.str(), rootNode);
|
readProperties(path.str(), rootNode);
|
||||||
const_cast<FGAirport*>(this)->readThresholdData(rootNode);
|
const_cast<FGAirport*>(this)->readThresholdData(rootNode);
|
||||||
cache->stampCacheFile(path);
|
cache->stampCacheFile(path);
|
||||||
txn.commit();
|
txn.commit();
|
||||||
|
} catch (sg_exception& e) {
|
||||||
|
SG_LOG(SG_NAVAID, SG_WARN, ident() << "loading threshold XML failed:" << e.getFormattedMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void FGAirport::readThresholdData(SGPropertyNode* aRoot)
|
void FGAirport::readThresholdData(SGPropertyNode* aRoot)
|
||||||
|
@ -654,12 +658,16 @@ void FGAirport::validateTowerData() const
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
flightgear::NavDataCache::Transaction txn(cache);
|
flightgear::NavDataCache::Transaction txn(cache);
|
||||||
SGPropertyNode_ptr rootNode = new SGPropertyNode;
|
SGPropertyNode_ptr rootNode = new SGPropertyNode;
|
||||||
readProperties(path.str(), rootNode);
|
readProperties(path.str(), rootNode);
|
||||||
const_cast<FGAirport*>(this)->readTowerData(rootNode);
|
const_cast<FGAirport*>(this)->readTowerData(rootNode);
|
||||||
cache->stampCacheFile(path);
|
cache->stampCacheFile(path);
|
||||||
txn.commit();
|
txn.commit();
|
||||||
|
} catch (sg_exception& e){
|
||||||
|
SG_LOG(SG_NAVAID, SG_WARN, ident() << "loading twr XML failed:" << e.getFormattedMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void FGAirport::readTowerData(SGPropertyNode* aRoot)
|
void FGAirport::readTowerData(SGPropertyNode* aRoot)
|
||||||
|
@ -706,6 +714,7 @@ bool FGAirport::validateILSData()
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
SGPropertyNode_ptr rootNode = new SGPropertyNode;
|
SGPropertyNode_ptr rootNode = new SGPropertyNode;
|
||||||
readProperties(path.str(), rootNode);
|
readProperties(path.str(), rootNode);
|
||||||
|
|
||||||
|
@ -713,9 +722,13 @@ bool FGAirport::validateILSData()
|
||||||
readILSData(rootNode);
|
readILSData(rootNode);
|
||||||
cache->stampCacheFile(path);
|
cache->stampCacheFile(path);
|
||||||
txn.commit();
|
txn.commit();
|
||||||
|
|
||||||
// we loaded data, tell the caller it might need to reload things
|
// we loaded data, tell the caller it might need to reload things
|
||||||
return true;
|
return true;
|
||||||
|
} catch (sg_exception& e){
|
||||||
|
SG_LOG(SG_NAVAID, SG_WARN, ident() << "loading ils XML failed:" << e.getFormattedMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void FGAirport::readILSData(SGPropertyNode* aRoot)
|
void FGAirport::readILSData(SGPropertyNode* aRoot)
|
||||||
|
|
Loading…
Reference in a new issue