]> git.mxchange.org Git - flightgear.git/commitdiff
Bracket threshold.xml loading in a DB transaction.
authorJames Turner <zakalawe@mac.com>
Mon, 19 Nov 2012 22:24:10 +0000 (22:24 +0000)
committerJames Turner <zakalawe@mac.com>
Mon, 19 Nov 2012 22:24:10 +0000 (22:24 +0000)
Should mitigate (but not completely fix, yet) bad map performance when initially zooming out, or panning when zoomed out.

src/Airports/simple.cxx

index 98aaba6f953fd276df827c1462e75ef0b14aefde..9fff74dc98d9df56a933958b77f0ab9bed65418e 100644 (file)
@@ -391,11 +391,17 @@ void FGAirport::loadSceneryDefinitions() const
     return;
   }
   
-  SGPropertyNode_ptr rootNode = new SGPropertyNode;
-  readProperties(path.str(), rootNode);
-  const_cast<FGAirport*>(this)->readThresholdData(rootNode);
-  cache->stampCacheFile(path);
-
+  try {
+    cache->beginTransaction();
+    SGPropertyNode_ptr rootNode = new SGPropertyNode;
+    readProperties(path.str(), rootNode);
+    const_cast<FGAirport*>(this)->readThresholdData(rootNode);
+    cache->stampCacheFile(path);
+    cache->commitTransaction();
+  } catch (sg_exception& e) {
+    cache->abortTransaction();
+    throw e;
+  }
 }
 
 void FGAirport::readThresholdData(SGPropertyNode* aRoot)