]> git.mxchange.org Git - flightgear.git/commitdiff
Fixed some uninitialized member vars and a mem leak.
authorThorstenB <brehmt@gmail.com>
Sun, 18 Nov 2012 15:39:22 +0000 (16:39 +0100)
committerThorstenB <brehmt@gmail.com>
Sun, 18 Nov 2012 15:39:22 +0000 (16:39 +0100)
src/ATC/atcdialog.cxx
src/Airports/simple.cxx
src/Autopilot/autopilot.cxx

index 13b93fb7ba7f6f265a6f6886c6dfecca7274b5a3..1bf0c9cddaf04089f98bee2a290760b314f4e073 100644 (file)
@@ -187,8 +187,9 @@ static bool doFrequencyDisplay( const SGPropertyNode* args )
 FGATCDialogNew * FGATCDialogNew::_instance = NULL;
 
 FGATCDialogNew::FGATCDialogNew()
+: _gui(NULL),
+   dialogVisible(true)
 {
-  dialogVisible = true;
 }
 
 FGATCDialogNew::~FGATCDialogNew()
@@ -198,15 +199,15 @@ FGATCDialogNew::~FGATCDialogNew()
 
 
 void FGATCDialogNew::init() {
-       // Add ATC-dialog to the command list
+    // Add ATC-dialog to the command list
     globals->get_commands()->addCommand("ATC-dialog", FGATCDialogNew::popup );
-       // Add ATC-freq-search to the command list
-       globals->get_commands()->addCommand("ATC-freq-search", doFrequencySearch);
-  globals->get_commands()->addCommand("ATC-freq-display", doFrequencyDisplay);
+    // Add ATC-freq-search to the command list
+    globals->get_commands()->addCommand("ATC-freq-search", doFrequencySearch);
+    globals->get_commands()->addCommand("ATC-freq-display", doFrequencyDisplay);
   
-       // initialize properties polled in Update()
-       //globals->get_props()->setStringValue("/sim/atc/freq-airport", "");
-       globals->get_props()->setIntValue("/sim/atc/transmission-num", -1);
+    // initialize properties polled in Update()
+    //globals->get_props()->setStringValue("/sim/atc/freq-airport", "");
+    globals->get_props()->setIntValue("/sim/atc/transmission-num", -1);
 }
 
 
index 84ed7ffabb39c561e49f0ab0782ca0ebe9a12d0f..3ebaf29e2d7fa4224f45892056f46b314398c714 100644 (file)
@@ -70,7 +70,9 @@ FGAirport::FGAirport(PositionedID aGuid, const string &id, const SGGeod& locatio
     _dynamics(0),
     mTowerDataLoaded(false),
     mRunwaysLoaded(false),
-    mTaxiwaysLoaded(false)
+    mTaxiwaysLoaded(false),
+    mProceduresLoaded(false),
+    mILSDataLoaded(false)
 {
 }
 
index a4a593158b8c371d9a382d813623c966cf03bb69..d6e87eb5e3acf83232ce675933b38333d1f533bd 100644 (file)
@@ -59,13 +59,15 @@ Autopilot::Autopilot( SGPropertyNode_ptr rootNode, SGPropertyNode_ptr configNode
   _serviceable(true),
   _rootNode(rootNode)
 {
-
-  componentForge["pid-controller"]       = new CreateAndConfigureFunctor<PIDController,Component>();
-  componentForge["pi-simple-controller"] = new CreateAndConfigureFunctor<PISimpleController,Component>();
-  componentForge["predict-simple"]       = new CreateAndConfigureFunctor<Predictor,Component>();
-  componentForge["filter"]               = new CreateAndConfigureFunctor<DigitalFilter,Component>();
-  componentForge["logic"]                = new CreateAndConfigureFunctor<Logic,Component>();
-  componentForge["flipflop"]             = new CreateAndConfigureFunctor<FlipFlop,Component>();
+  if (componentForge.empty())
+  {
+      componentForge["pid-controller"]       = new CreateAndConfigureFunctor<PIDController,Component>();
+      componentForge["pi-simple-controller"] = new CreateAndConfigureFunctor<PISimpleController,Component>();
+      componentForge["predict-simple"]       = new CreateAndConfigureFunctor<Predictor,Component>();
+      componentForge["filter"]               = new CreateAndConfigureFunctor<DigitalFilter,Component>();
+      componentForge["logic"]                = new CreateAndConfigureFunctor<Logic,Component>();
+      componentForge["flipflop"]             = new CreateAndConfigureFunctor<FlipFlop,Component>();
+  }
 
   if( configNode == NULL ) configNode = rootNode;