From: James Turner Date: Mon, 19 Nov 2012 22:24:10 +0000 (+0000) Subject: Bracket threshold.xml loading in a DB transaction. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=18da917ddd7e456d83e4cbad561fc988014ffe12;p=flightgear.git Bracket threshold.xml loading in a DB transaction. Should mitigate (but not completely fix, yet) bad map performance when initially zooming out, or panning when zoomed out. --- diff --git a/src/Airports/simple.cxx b/src/Airports/simple.cxx index 98aaba6f9..9fff74dc9 100644 --- a/src/Airports/simple.cxx +++ b/src/Airports/simple.cxx @@ -391,11 +391,17 @@ void FGAirport::loadSceneryDefinitions() const return; } - SGPropertyNode_ptr rootNode = new SGPropertyNode; - readProperties(path.str(), rootNode); - const_cast(this)->readThresholdData(rootNode); - cache->stampCacheFile(path); - + try { + cache->beginTransaction(); + SGPropertyNode_ptr rootNode = new SGPropertyNode; + readProperties(path.str(), rootNode); + const_cast(this)->readThresholdData(rootNode); + cache->stampCacheFile(path); + cache->commitTransaction(); + } catch (sg_exception& e) { + cache->abortTransaction(); + throw e; + } } void FGAirport::readThresholdData(SGPropertyNode* aRoot)