1
0
Fork 0

- FGPropertyManager.{cpp,h}: fix memory corruption bug

- JSBSim.?xx: use guarded SGPropertyNode pointers
This commit is contained in:
mfranz 2007-03-19 16:37:36 +00:00
parent 937ec42fda
commit e85b413f99
4 changed files with 34 additions and 32 deletions

View file

@ -886,7 +886,7 @@ bool FGJSBsim::ToggleDataLogging(bool state)
//Positions
void FGJSBsim::set_Latitude(double lat)
{
static const SGPropertyNode *altitude = fgGetNode("/position/altitude-ft");
static SGConstPropertyNode_ptr altitude = fgGetNode("/position/altitude-ft");
double alt;
double sea_level_radius_meters, lat_geoc;
@ -926,7 +926,7 @@ void FGJSBsim::set_Longitude(double lon)
void FGJSBsim::set_Altitude(double alt)
{
static const SGPropertyNode *latitude = fgGetNode("/position/latitude-deg");
static SGConstPropertyNode_ptr latitude = fgGetNode("/position/latitude-deg");
double sea_level_radius_meters,lat_geoc;

View file

@ -226,42 +226,42 @@ private:
double trim_elev;
double trim_throttle;
SGPropertyNode *startup_trim;
SGPropertyNode *trimmed;
SGPropertyNode *pitch_trim;
SGPropertyNode *throttle_trim;
SGPropertyNode *aileron_trim;
SGPropertyNode *rudder_trim;
SGPropertyNode *stall_warning;
SGPropertyNode_ptr startup_trim;
SGPropertyNode_ptr trimmed;
SGPropertyNode_ptr pitch_trim;
SGPropertyNode_ptr throttle_trim;
SGPropertyNode_ptr aileron_trim;
SGPropertyNode_ptr rudder_trim;
SGPropertyNode_ptr stall_warning;
/* SGPropertyNode *elevator_pos_deg;
SGPropertyNode *left_aileron_pos_deg;
SGPropertyNode *right_aileron_pos_deg;
SGPropertyNode *rudder_pos_deg;
SGPropertyNode *flap_pos_deg; */
/* SGPropertyNode_ptr elevator_pos_deg;
SGPropertyNode_ptr left_aileron_pos_deg;
SGPropertyNode_ptr right_aileron_pos_deg;
SGPropertyNode_ptr rudder_pos_deg;
SGPropertyNode_ptr flap_pos_deg; */
SGPropertyNode *elevator_pos_pct;
SGPropertyNode *left_aileron_pos_pct;
SGPropertyNode *right_aileron_pos_pct;
SGPropertyNode *rudder_pos_pct;
SGPropertyNode *flap_pos_pct;
SGPropertyNode *speedbrake_pos_pct;
SGPropertyNode *spoilers_pos_pct;
SGPropertyNode_ptr elevator_pos_pct;
SGPropertyNode_ptr left_aileron_pos_pct;
SGPropertyNode_ptr right_aileron_pos_pct;
SGPropertyNode_ptr rudder_pos_pct;
SGPropertyNode_ptr flap_pos_pct;
SGPropertyNode_ptr speedbrake_pos_pct;
SGPropertyNode_ptr spoilers_pos_pct;
SGPropertyNode *gear_pos_pct;
SGPropertyNode_ptr gear_pos_pct;
SGPropertyNode *temperature;
SGPropertyNode *pressure;
SGPropertyNode *density;
SGPropertyNode *turbulence_gain;
SGPropertyNode *turbulence_rate;
SGPropertyNode_ptr temperature;
SGPropertyNode_ptr pressure;
SGPropertyNode_ptr density;
SGPropertyNode_ptr turbulence_gain;
SGPropertyNode_ptr turbulence_rate;
SGPropertyNode *wind_from_north;
SGPropertyNode *wind_from_east;
SGPropertyNode *wind_from_down;
SGPropertyNode_ptr wind_from_north;
SGPropertyNode_ptr wind_from_east;
SGPropertyNode_ptr wind_from_down;
SGPropertyNode *slaved;
SGPropertyNode_ptr slaved;
void init_gear(void);
void update_gear(void);

View file

@ -48,6 +48,8 @@ COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
namespace JSBSim {
bool FGPropertyManager::suppress_warning = true;
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
string FGPropertyManager::mkPropertyName(string name, bool lowercase) {

View file

@ -73,7 +73,7 @@ CLASS DECLARATION
class FGPropertyManager : public SGPropertyNode, public FGJSBBase
{
private:
bool suppress_warning;
static bool suppress_warning;
public:
/// Constructor
FGPropertyManager(void) {suppress_warning = false;}