diff --git a/src/Airports/GenAirports850/main.cxx b/src/Airports/GenAirports850/main.cxx index ec1554bd..fb89bb78 100644 --- a/src/Airports/GenAirports850/main.cxx +++ b/src/Airports/GenAirports850/main.cxx @@ -350,8 +350,7 @@ int main(int argc, char **argv) } } - TG_LOG(SG_GENERAL, SG_INFO, "Done"); - exit(0); + TG_LOG(SG_GENERAL, SG_INFO, "Genapts finished successfully"); return 0; } diff --git a/src/Airports/GenAirports850/parser.cxx b/src/Airports/GenAirports850/parser.cxx index 95de72ff..1ba73e7f 100644 --- a/src/Airports/GenAirports850/parser.cxx +++ b/src/Airports/GenAirports850/parser.cxx @@ -10,7 +10,6 @@ bool Parser::GetAirportDefinition( char* line, std::string& icao ) { char* tok; int code; - Airport* airport = NULL; bool match = false; // Get the number code @@ -26,9 +25,11 @@ bool Parser::GetAirportDefinition( char* line, std::string& icao ) case LAND_AIRPORT_CODE: case SEA_AIRPORT_CODE: case HELIPORT_CODE: - airport = new Airport( code, line ); - icao = airport->GetIcao(); + { + Airport ap( code, line ); + icao = ap.GetIcao(); match = true; + } break; default: @@ -592,7 +593,7 @@ int Parser::ParseLine(char* line) if ( prev_node && (cur_node != prev_node) ) { - // prev node is done - process it\n"); + // prev node is done - process it if ( cur_state == STATE_PARSE_PAVEMENT ) { cur_pavement->AddNode( prev_node ); @@ -606,7 +607,7 @@ int Parser::ParseLine(char* line) cur_boundary->AddNode( prev_node ); } } - + prev_node = cur_node; break; @@ -775,4 +776,4 @@ int Parser::ParseLine(char* line) } return cur_state; -} \ No newline at end of file +} diff --git a/src/Airports/GenAirports850/scheduler.cxx b/src/Airports/GenAirports850/scheduler.cxx index 932b2caf..2c1e69ee 100644 --- a/src/Airports/GenAirports850/scheduler.cxx +++ b/src/Airports/GenAirports850/scheduler.cxx @@ -179,7 +179,6 @@ bool Scheduler::IsAirportDefinition( char* line, std::string icao ) { char* tok; int code; - Airport* airport = NULL; bool match = false; // Get the number code @@ -195,11 +194,13 @@ bool Scheduler::IsAirportDefinition( char* line, std::string icao ) case LAND_AIRPORT_CODE: case SEA_AIRPORT_CODE: case HELIPORT_CODE: - airport = new Airport( code, line ); - if ( airport->GetIcao() == icao ) + { + Airport ap( code, line ); + if ( ap.GetIcao() == icao ) { match = true; } + } break; case LAND_RUNWAY_CODE: @@ -510,5 +511,6 @@ void Scheduler::Schedule( int num_threads, std::string& summaryfile ) // Then wait until they are finished for (unsigned int i=0; ijoin(); + delete parsers[i]; } }