]> git.mxchange.org Git - flightgear.git/commitdiff
move the "interpolator" subsystem into the INIT group (same as "nasal"),
authormfranz <mfranz>
Tue, 1 May 2007 18:06:48 +0000 (18:06 +0000)
committermfranz <mfranz>
Tue, 1 May 2007 18:06:48 +0000 (18:06 +0000)
because nasal's f_interpolate() may be called in Nasal at times when the
GENERAL subsystem group is being deconstructed; access it by addressing
the group directly, as using globals->get_subsystem() does then not
work any more then; yeah, it's all for a rare border case ...  :-)

src/Main/fg_init.cxx
src/Scripting/NasalSys.cxx

index 3b3c68b3ffa37cdf6c75fd1b2cb0206a318b1064..d50e4f7ab28cc751515f3fb2cc3d48cf7c216b89 100644 (file)
@@ -1579,9 +1579,10 @@ bool fgInitSubsystems() {
     globals->get_event_mgr()->setRealtimeProperty(fgGetNode("/sim/time/delta-realtime-sec", true));
 
     ////////////////////////////////////////////////////////////////////
-    // Initialize the property interpolator subsystem
+    // Initialize the property interpolator subsystem. Put into the INIT
+    // group because the "nasal" subsystem may need it at GENERAL take-down.
     ////////////////////////////////////////////////////////////////////
-    globals->add_subsystem("interpolator", new SGInterpolator);
+    globals->add_subsystem("interpolator", new SGInterpolator, SGSubsystemMgr::INIT);
 
 
     ////////////////////////////////////////////////////////////////////
index 81effe1e54d6483727cd96611caad81d2d1d6e37..95ecda99b0da7b60ac272c5503de45356d37d3ac 100644 (file)
@@ -306,7 +306,8 @@ static naRef f_interpolate(naContext c, naRef me, int argc, naRef* args)
         deltas[i] = naNumValue(naVec_get(curve, 2*i+1)).num;
     }
 
-    ((SGInterpolator*)globals->get_subsystem("interpolator"))
+    ((SGInterpolator*)globals->get_subsystem_mgr()
+        ->get_group(SGSubsystemMgr::INIT)->get_subsystem("interpolator"))
         ->interpolate(node, nPoints, values, deltas);
 
     return naNil();