The C++ standard explicitly allows deleting a null pointer.
FGAIFlightPlan::~FGAIFlightPlan()
{
deleteWaypoints();
- if (taxiRoute)
- delete taxiRoute;
+ delete taxiRoute;
}
void FGAIFlightPlan::deleteTaxiRoute()
{
- if (taxiRoute)
- delete taxiRoute;
+ delete taxiRoute;
taxiRoute = 0;
}
// Starting from gate 0 in this case is a bit of a hack
// which requires a more proper solution later on.
//FGTaxiRoute route;
- if (taxiRoute)
- delete taxiRoute;
+ delete taxiRoute;
taxiRoute = new FGTaxiRoute;
if (gateId >= 0)
*taxiRoute = apt->getDynamics()->getGroundNetwork()->findShortestRoute(gateId,
// fallback mechanism for this.
// Starting from gate 0 is a bit of a hack...
//FGTaxiRoute route;
- if (taxiRoute)
- delete taxiRoute;
+ delete taxiRoute;
taxiRoute = new FGTaxiRoute;
if (gateId >= 0)
*taxiRoute = apt->getDynamics()->getGroundNetwork()->findShortestRoute(runwayId,