From: ThorstenB Date: Sun, 18 Nov 2012 15:39:22 +0000 (+0100) Subject: Fixed some uninitialized member vars and a mem leak. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=58380b286e5c2ddbb2b9389a8042754aa649092c;p=flightgear.git Fixed some uninitialized member vars and a mem leak. --- diff --git a/src/ATC/atcdialog.cxx b/src/ATC/atcdialog.cxx index 13b93fb7b..1bf0c9cdd 100644 --- a/src/ATC/atcdialog.cxx +++ b/src/ATC/atcdialog.cxx @@ -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); } diff --git a/src/Airports/simple.cxx b/src/Airports/simple.cxx index 84ed7ffab..3ebaf29e2 100644 --- a/src/Airports/simple.cxx +++ b/src/Airports/simple.cxx @@ -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) { } diff --git a/src/Autopilot/autopilot.cxx b/src/Autopilot/autopilot.cxx index a4a593158..d6e87eb5e 100644 --- a/src/Autopilot/autopilot.cxx +++ b/src/Autopilot/autopilot.cxx @@ -59,13 +59,15 @@ Autopilot::Autopilot( SGPropertyNode_ptr rootNode, SGPropertyNode_ptr configNode _serviceable(true), _rootNode(rootNode) { - - componentForge["pid-controller"] = new CreateAndConfigureFunctor(); - componentForge["pi-simple-controller"] = new CreateAndConfigureFunctor(); - componentForge["predict-simple"] = new CreateAndConfigureFunctor(); - componentForge["filter"] = new CreateAndConfigureFunctor(); - componentForge["logic"] = new CreateAndConfigureFunctor(); - componentForge["flipflop"] = new CreateAndConfigureFunctor(); + if (componentForge.empty()) + { + componentForge["pid-controller"] = new CreateAndConfigureFunctor(); + componentForge["pi-simple-controller"] = new CreateAndConfigureFunctor(); + componentForge["predict-simple"] = new CreateAndConfigureFunctor(); + componentForge["filter"] = new CreateAndConfigureFunctor(); + componentForge["logic"] = new CreateAndConfigureFunctor(); + componentForge["flipflop"] = new CreateAndConfigureFunctor(); + } if( configNode == NULL ) configNode = rootNode;