mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-31 05:21:35 +08:00
vtol_att_control: initialise pointers and free memory
Signed-off-by: Roman <bapstroman@gmail.com>
This commit is contained in:
@@ -177,6 +177,11 @@ VtolAttitudeControl::~VtolAttitudeControl()
|
|||||||
} while (_control_task != -1);
|
} while (_control_task != -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// free memory used by instances of base class VtolType
|
||||||
|
if (_vtol_type != nullptr) {
|
||||||
|
delete _vtol_type;
|
||||||
|
}
|
||||||
|
|
||||||
VTOL_att_control::g_control = nullptr;
|
VTOL_att_control::g_control = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -218,10 +218,10 @@ private:
|
|||||||
int _transition_command;
|
int _transition_command;
|
||||||
bool _abort_front_transition;
|
bool _abort_front_transition;
|
||||||
|
|
||||||
VtolType *_vtol_type; // base class for different vtol types
|
VtolType *_vtol_type = nullptr; // base class for different vtol types
|
||||||
Tiltrotor *_tiltrotor; // tailsitter vtol type
|
Tiltrotor *_tiltrotor = nullptr; // tailsitter vtol type
|
||||||
Tailsitter *_tailsitter; // tiltrotor vtol type
|
Tailsitter *_tailsitter = nullptr; // tiltrotor vtol type
|
||||||
Standard *_standard; // standard vtol type
|
Standard *_standard = nullptr; // standard vtol type
|
||||||
|
|
||||||
//*****************Member functions***********************************************************************
|
//*****************Member functions***********************************************************************
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user