- remove listener first in the destructor
- make function arg const again
This commit is contained in:
parent
244547eb4c
commit
6c1be4fffb
2 changed files with 11 additions and 12 deletions
|
@ -68,8 +68,8 @@ FGRouteMgr::FGRouteMgr() :
|
||||||
|
|
||||||
|
|
||||||
FGRouteMgr::~FGRouteMgr() {
|
FGRouteMgr::~FGRouteMgr() {
|
||||||
delete route;
|
|
||||||
input->removeChangeListener(listener);
|
input->removeChangeListener(listener);
|
||||||
|
delete route;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -280,14 +280,7 @@ bool FGRouteMgr::build() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int FGRouteMgr::new_waypoint( const string& Tgt_Alt, int n ) {
|
int FGRouteMgr::new_waypoint( const string& target, int n ) {
|
||||||
string target = Tgt_Alt;
|
|
||||||
|
|
||||||
// make upper case
|
|
||||||
for (unsigned int i = 0; i < target.size(); i++)
|
|
||||||
if (target[i] >= 'a' && target[i] <= 'z')
|
|
||||||
target[i] -= 'a' - 'A';
|
|
||||||
|
|
||||||
SGWayPoint *wp = 0;
|
SGWayPoint *wp = 0;
|
||||||
int type = make_waypoint( &wp, target );
|
int type = make_waypoint( &wp, target );
|
||||||
|
|
||||||
|
@ -302,10 +295,16 @@ int FGRouteMgr::new_waypoint( const string& Tgt_Alt, int n ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int FGRouteMgr::make_waypoint(SGWayPoint **wp, string& target) {
|
int FGRouteMgr::make_waypoint( SGWayPoint **wp, const string& tgt ) {
|
||||||
double alt = -9999.0;
|
string target = tgt;
|
||||||
|
|
||||||
|
// make upper case
|
||||||
|
for (unsigned int i = 0; i < target.size(); i++)
|
||||||
|
if (target[i] >= 'a' && target[i] <= 'z')
|
||||||
|
target[i] -= 'a' - 'A';
|
||||||
|
|
||||||
// extract altitude
|
// extract altitude
|
||||||
|
double alt = -9999.0;
|
||||||
unsigned int pos = target.find( '@' );
|
unsigned int pos = target.find( '@' );
|
||||||
if ( pos != string::npos ) {
|
if ( pos != string::npos ) {
|
||||||
alt = atof( target.c_str() + pos + 1 );
|
alt = atof( target.c_str() + pos + 1 );
|
||||||
|
|
|
@ -93,7 +93,7 @@ private:
|
||||||
SGPropertyNode_ptr mirror;
|
SGPropertyNode_ptr mirror;
|
||||||
bool altitude_set;
|
bool altitude_set;
|
||||||
|
|
||||||
int make_waypoint( SGWayPoint **wp, string& target );
|
int make_waypoint( SGWayPoint **wp, const string& target );
|
||||||
void update_mirror();
|
void update_mirror();
|
||||||
bool near_ground();
|
bool near_ground();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue