]> git.mxchange.org Git - flightgear.git/blobdiff - src/Main/main.cxx
Crash-fix: mat-lib is now reference-counted.
[flightgear.git] / src / Main / main.cxx
index 40af6e292fb89605037f9107e61fc3c3fe366490..2062a3796d74afb9a03b69cdfa8e9b252bcf380d 100644 (file)
 #include <osg/GraphicsContext>
 #include <osgDB/Registry>
 
+#if defined(HAVE_CRASHRPT)
+       #include <CrashRpt.h>
+#endif
+
 // Class references
 #include <simgear/canvas/VGInitOperation.hxx>
 #include <simgear/scene/model/modellib.hxx>
@@ -101,6 +105,11 @@ static void fgMainLoop( void )
 
 static void initTerrasync()
 {
+    // add the terrasync root as a data path so data can be retrieved from it
+    // (even if we are in read-only mode)
+    std::string terraSyncDir(fgGetString("/sim/terrasync/scenery-dir"));
+    globals->append_data_path(terraSyncDir);
+    
     if (fgGetBool("/sim/fghome-readonly", false)) {
         return;
     }
@@ -127,10 +136,6 @@ static void initTerrasync()
     
     terra_sync->bind();
     terra_sync->init();
-    
-    // add the terrasync root as a data path so data can be retrieved from it
-    std::string terraSyncDir(fgGetString("/sim/terrasync/scenery-dir"));
-    globals->append_data_path(terraSyncDir);
 }
 
 static void registerMainLoop()
@@ -338,6 +343,10 @@ static void logToFile()
         logPath.append("fgfs.log");
     }
     sglog().logToFile(logPath, SG_ALL, SG_INFO);
+
+#if defined(HAVE_CRASHRPT)
+       crAddFile2(logPath.c_str(), NULL, "FlightGear Log File", CR_AF_MAKE_FILE_COPY);
+#endif
 }
 
 // Main top level initialization