From 1f07903cd6997f2ccfe10c8ecf6f51920f32042f Mon Sep 17 00:00:00 2001 From: mfranz Date: Tue, 1 May 2007 18:06:48 +0000 Subject: [PATCH] move the "interpolator" subsystem into the INIT group (same as "nasal"), 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 | 5 +++-- src/Scripting/NasalSys.cxx | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Main/fg_init.cxx b/src/Main/fg_init.cxx index 3b3c68b3f..d50e4f7ab 100644 --- a/src/Main/fg_init.cxx +++ b/src/Main/fg_init.cxx @@ -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); //////////////////////////////////////////////////////////////////// diff --git a/src/Scripting/NasalSys.cxx b/src/Scripting/NasalSys.cxx index 81effe1e5..95ecda99b 100644 --- a/src/Scripting/NasalSys.cxx +++ b/src/Scripting/NasalSys.cxx @@ -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();