After the recent changes (move of random objects placement manager to
SG etc.), fgfs crashes when preferences contains model definitions as
in:

  <models>
        <model>
              <name>Windsock HOERSCHING</name>
              <path>Models/Airport/windsock.xml</path>
              <longitude-deg type="double">14.2035</longitude-deg>
              <latitude-deg type="double">48.2315</latitude-deg>
              <elevation-ft type="double">909</elevation-ft>
        </model>
  </models>

The reason: these models are to be added to the scenery, but the
scenery isn't yet set up at this point. The correct order is:

 - set up model_lib (needed by the scenery)
 - set up scenery (needed by the model manager)
 - set up model manager

m.



Index: main.cxx
===================================================================
RCS file: /var/cvs/FlightGear-0.9/FlightGear/src/Main/main.cxx,v
retrieving revision 1.91
diff -u -p -r1.91 main.cxx
--- main.cxx    28 May 2003 20:29:05 -0000      1.91
+++ main.cxx    29 May 2003 12:13:52 -0000
@@ -1691,13 +1691,7 @@ static bool fgMainInit( int argc, char *
     ////////////////////////////////////////////////////////////////////
     globals->set_matlib( new SGMaterialLib );

-    ////////////////////////////////////////////////////////////////////
-    // Initialize the general model subsystem.
-    ////////////////////////////////////////////////////////////////////
     globals->set_model_lib(new SGModelLib);
-    globals->set_model_mgr(new FGModelMgr);
-    globals->get_model_mgr()->init();
-    globals->get_model_mgr()->bind();

     ////////////////////////////////////////////////////////////////////
     // Initialize the TG scenery subsystem.
@@ -1708,6 +1702,13 @@ static bool fgMainInit( int argc, char *
     globals->set_tile_mgr( new FGTileMgr );

     ////////////////////////////////////////////////////////////////////
+    // Initialize the general model subsystem.
+    ////////////////////////////////////////////////////////////////////
+    globals->set_model_mgr(new FGModelMgr);
+    globals->get_model_mgr()->init();
+    globals->get_model_mgr()->bind();
+
+    ////////////////////////////////////////////////////////////////////
     // Initialize the 3D aircraft model subsystem (has a dependency on
     // the scenery subsystem.)
     ////////////////////////////////////////////////////////////////////

_______________________________________________
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel

Reply via email to