From 18da917ddd7e456d83e4cbad561fc988014ffe12 Mon Sep 17 00:00:00 2001 From: James Turner Date: Mon, 19 Nov 2012 22:24:10 +0000 Subject: [PATCH] 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. --- src/Airports/simple.cxx | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) 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) -- 2.39.5